Object
# File lib/mail/version_specific/ruby_1_9.rb, line 50
50: def Ruby19.b_value_decode(str)
51: match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/)
52: if match
53: encoding = match[1]
54: str = Ruby19.decode_base64(match[2])
55: str.force_encoding(encoding)
56: end
57: str
58: end
# File lib/mail/version_specific/ruby_1_9.rb, line 45
45: def Ruby19.b_value_encode(str, encoding = nil)
46: encoding = str.encoding.to_s
47: [Ruby19.encode_base64(str), encoding]
48: end
# File lib/mail/version_specific/ruby_1_9.rb, line 23
23: def Ruby19.bracket( str )
24: str = $1 if str =~ /^\<(.*)?\>$/
25: str = escape_bracket( str )
26: '<' + str + '>'
27: end
# File lib/mail/version_specific/ruby_1_9.rb, line 29
29: def Ruby19.decode_base64(str)
30: str.unpack( 'm' ).first.force_encoding(Encoding::BINARY)
31: end
# File lib/mail/version_specific/ruby_1_9.rb, line 33
33: def Ruby19.encode_base64(str)
34: [str].pack( 'm' )
35: end
# File lib/mail/version_specific/ruby_1_9.rb, line 18
18: def Ruby19.escape_bracket( str )
19: re = /(?<!\\)([\<\>])/ # Only match unescaped brackets
20: str.gsub(re) { |s| '\' + s }
21: end
Escapes any parenthesis in a string that are unescaped this uses a Ruby 1.9.1 regexp feature of negative look behind
# File lib/mail/version_specific/ruby_1_9.rb, line 7
7: def Ruby19.escape_paren( str )
8: re = /(?<!\\)([\(\)])/ # Only match unescaped parens
9: str.gsub(re) { |s| '\' + s }
10: end
# File lib/mail/version_specific/ruby_1_9.rb, line 41
41: def Ruby19.get_constant(klass, string)
42: klass.const_get( string.to_sym )
43: end
# File lib/mail/version_specific/ruby_1_9.rb, line 37
37: def Ruby19.has_constant?(klass, string)
38: klass.constants.include?( string.to_sym )
39: end
# File lib/mail/version_specific/ruby_1_9.rb, line 75
75: def Ruby19.param_decode(str, encoding)
76: string = URI.unescape(str)
77: string.force_encoding(encoding) if encoding
78: string
79: end
# File lib/mail/version_specific/ruby_1_9.rb, line 81
81: def Ruby19.param_encode(str)
82: encoding = str.encoding.to_s.downcase
83: language = Configuration.instance.param_encode_language
84: "#{encoding}'#{language}'#{URI.escape(str)}"
85: end
# File lib/mail/version_specific/ruby_1_9.rb, line 12
12: def Ruby19.paren( str )
13: str = $1 if str =~ /^\((.*)?\)$/
14: str = escape_paren( str )
15: '(' + str + ')'
16: end
# File lib/mail/version_specific/ruby_1_9.rb, line 65
65: def Ruby19.q_value_decode(str)
66: match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/)
67: if match
68: encoding = match[1]
69: str = Encodings::QuotedPrintable.decode(match[2])
70: str.force_encoding(encoding)
71: end
72: str
73: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.