Skip to content

Commit

Permalink
Fix code when ActiveSupport is required
Browse files Browse the repository at this point in the history
Mail::Multibyte is not defined in that case, so we just force everything
to be a string.
  • Loading branch information
ConradIrwin committed Feb 8, 2013
1 parent 2ff5318 commit ed25868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mail/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def method_missing(name, *args, &block)

def split(raw_field)
match_data = raw_field.mb_chars.match(FIELD_SPLIT)
[match_data[1].to_s.mb_chars.strip, match_data[2].to_s.mb_chars.strip]
[match_data[1].to_s.mb_chars.strip, match_data[2].to_s.mb_chars.strip.to_s]
rescue
STDERR.puts "WARNING: Could not parse (and so ignoring) '#{raw_field}'"
end
Expand All @@ -213,7 +213,7 @@ def unfold(string)
end

def create_field(name, value, charset)
value = unfold(value) if value.is_a?(String) || value.is_a?(Mail::Multibyte::Chars)
value = unfold(value) if value.is_a?(String)

begin
new_field(name, value, charset)
Expand Down

0 comments on commit ed25868

Please sign in to comment.