Module | MaRuKu::Strings |
In: |
lib/maruku.rb
lib/maruku/string_utils.rb |
Utility functions for dealing with strings.
TAB_SIZE | = | 4 |
Parses email headers, returning a hash. `hash[:data]` is the message; that is, anything past the headers.
Keys are downcased and converted to symbols; spaces become underscores. For example:
!!!plain My key: true
becomes:
{:my_key => true}
@param s [String] The email @return [Symbol => String] The header values
This returns the position of the first non-list character in a list item.
@example spaces_before_first_char(’*Hello’) #=> 1 spaces_before_first_char(’* Hello’) #=> 2 spaces_before_first_char(’ * Hello’) #=> 3 spaces_before_first_char(’ * Hello’) #=> 5 spaces_before_first_char(‘1.Hello’) #=> 2 spaces_before_first_char(’ 1. Hello’) #=> 5
@param s [String] @return [Fixnum]