jpmobile 1.0.0.pre.5 → 1.0.0.pre.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +2 -2
- data/lib/jpmobile/mail.rb +105 -20
- data/lib/jpmobile/mobile/abstract_mobile.rb +2 -1
- data/spec/unit/mail_spec.rb +45 -9
- metadata +53 -143
    
        data/VERSION.yml
    CHANGED
    
    
    
        data/lib/jpmobile/mail.rb
    CHANGED
    
    | @@ -1,12 +1,6 @@ | |
| 1 1 | 
             
            # -*- coding: utf-8 -*-
         | 
| 2 2 | 
             
            require 'mail'
         | 
| 3 3 |  | 
| 4 | 
            -
            module Jpmobile
         | 
| 5 | 
            -
              module Mail
         | 
| 6 | 
            -
                module_function
         | 
| 7 | 
            -
              end
         | 
| 8 | 
            -
            end
         | 
| 9 | 
            -
             | 
| 10 4 | 
             
            module Mail
         | 
| 11 5 | 
             
              # encoding patch
         | 
| 12 6 | 
             
              if self.const_defined?(:Ruby19)
         | 
| @@ -21,6 +15,12 @@ module Mail | |
| 21 15 | 
             
                    # if str contains some emoticon, the following line raises Encoding error
         | 
| 22 16 | 
             
                    str.encode("utf-8", :invalid => :replace, :replace => "") rescue Jpmobile::Util.ascii_8bit(str)
         | 
| 23 17 | 
             
                  end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  # change encoding
         | 
| 20 | 
            +
                  def self.b_value_encode(str, encoding)
         | 
| 21 | 
            +
                    str = Jpmobile::Util.encode(str, encoding)
         | 
| 22 | 
            +
                    [Ruby19.encode_base64(str), encoding]
         | 
| 23 | 
            +
                  end
         | 
| 24 24 | 
             
                end
         | 
| 25 25 | 
             
              elsif self.const_defined?(:Ruby18)
         | 
| 26 26 | 
             
                Ruby18.class_eval do
         | 
| @@ -32,6 +32,12 @@ module Mail | |
| 32 32 | 
             
                    end
         | 
| 33 33 | 
             
                    str
         | 
| 34 34 | 
             
                  end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                  # change encoding
         | 
| 37 | 
            +
                  def self.b_value_encode(str, encoding)
         | 
| 38 | 
            +
                    str = Jpmobile::Util.encode(str, encoding)
         | 
| 39 | 
            +
                    [Encodings::Base64.encode(str), encoding]
         | 
| 40 | 
            +
                  end
         | 
| 35 41 | 
             
                end
         | 
| 36 42 | 
             
              end
         | 
| 37 43 |  | 
| @@ -39,7 +45,7 @@ module Mail | |
| 39 45 | 
             
                attr_accessor :mobile
         | 
| 40 46 |  | 
| 41 47 | 
             
                def mobile=(m)
         | 
| 42 | 
            -
                  if @mobile | 
| 48 | 
            +
                  if @mobile = m
         | 
| 43 49 | 
             
                    @charset = m.mail_charset(@charset)
         | 
| 44 50 |  | 
| 45 51 | 
             
                    if @body
         | 
| @@ -52,6 +58,8 @@ module Mail | |
| 52 58 | 
             
                def encoded_with_jpmobile
         | 
| 53 59 | 
             
                  if @mobile
         | 
| 54 60 | 
             
                    header['subject'].mobile = @mobile if header['subject']
         | 
| 61 | 
            +
                    header['from'].mobile    = @mobile if header['from']
         | 
| 62 | 
            +
                    header['to'].mobile      = @mobile if header['to']
         | 
| 55 63 | 
             
                    self.charset             = @mobile.mail_charset(@charset)
         | 
| 56 64 |  | 
| 57 65 | 
             
                    ready_to_send!
         | 
| @@ -132,37 +140,41 @@ module Mail | |
| 132 140 | 
             
                private
         | 
| 133 141 | 
             
                def convert_encoding_jpmobile
         | 
| 134 142 | 
             
                  # decide mobile carrier
         | 
| 135 | 
            -
                  if self.header[ | 
| 136 | 
            -
                    mobile_class = Jpmobile::Email.detect_from_mail_header(self.header[ | 
| 143 | 
            +
                  if self.header[:from]
         | 
| 144 | 
            +
                    mobile_class = Jpmobile::Email.detect_from_mail_header(self.header[:from].value)
         | 
| 137 145 | 
             
                    @mobile ||= mobile_class.new(nil, nil) if mobile_class
         | 
| 138 146 | 
             
                  end
         | 
| 139 147 |  | 
| 140 148 | 
             
                  # override charset
         | 
| 141 | 
            -
                  if self.header[ | 
| 142 | 
            -
                    content_type_charset = Jpmobile::Util.extract_charset(self.header[ | 
| 149 | 
            +
                  if self.header[:content_type]
         | 
| 150 | 
            +
                    content_type_charset = Jpmobile::Util.extract_charset(self.header[:content_type].value)
         | 
| 143 151 | 
             
                    unless content_type_charset.blank?
         | 
| 144 152 | 
             
                      @charset = content_type_charset
         | 
| 145 | 
            -
                      self.header[ | 
| 146 | 
            -
                      @mobile_main_type = self.header[ | 
| 153 | 
            +
                      self.header[:content_type].parameters[:charset] = @charset
         | 
| 154 | 
            +
                      @mobile_main_type = self.header[:content_type].main_type
         | 
| 147 155 | 
             
                    end
         | 
| 148 156 |  | 
| 149 | 
            -
                    if !Jpmobile::Email.convertable?(self.header[ | 
| 157 | 
            +
                    if !Jpmobile::Email.convertable?(self.header[:content_type].value) and content_type_charset.blank?
         | 
| 150 158 | 
             
                      @charset = ''
         | 
| 151 159 | 
             
                    end
         | 
| 152 160 | 
             
                  end
         | 
| 153 161 |  | 
| 154 162 | 
             
                  # convert header(s)
         | 
| 155 | 
            -
                  if self.header[ | 
| 156 | 
            -
                    subject_charset = Jpmobile::Util.extract_charset(self.header[ | 
| 163 | 
            +
                  if self.header[:subject]
         | 
| 164 | 
            +
                    subject_charset = Jpmobile::Util.extract_charset(self.header[:subject].value)
         | 
| 157 165 |  | 
| 158 166 | 
             
                    # override subject encoding if @charset is blank
         | 
| 159 167 | 
             
                    @charset = subject_charset if !subject_charset.blank? # and @charset.blank?
         | 
| 160 | 
            -
                    self.header[ | 
| 168 | 
            +
                    self.header[:subject].charset = subject_charset unless subject_charset.blank?
         | 
| 161 169 |  | 
| 162 170 | 
             
                    if @mobile
         | 
| 163 171 | 
             
                      v = @mobile.to_mail_internal(
         | 
| 164 | 
            -
                        Encodings.value_decode(self.header[ | 
| 165 | 
            -
                       | 
| 172 | 
            +
                        Encodings.value_decode(self.header[:subject].value), subject_charset)
         | 
| 173 | 
            +
                      if @charset == subject_charset and @mobile.mail_charset != @charset
         | 
| 174 | 
            +
                        self.header[:subject].value = Jpmobile::Util.force_encode(v, @charset, Jpmobile::Util::UTF8)
         | 
| 175 | 
            +
                      else
         | 
| 176 | 
            +
                        self.header[:subject].value = Jpmobile::Util.force_encode(v, @mobile.mail_charset(@charset), Jpmobile::Util::UTF8)
         | 
| 177 | 
            +
                      end
         | 
| 166 178 | 
             
                    end
         | 
| 167 179 | 
             
                  end
         | 
| 168 180 |  | 
| @@ -239,6 +251,9 @@ module Mail | |
| 239 251 |  | 
| 240 252 | 
             
                def decode_transfer_encoding
         | 
| 241 253 | 
             
                  _raw_source = Encodings.get_encoding(encoding).decode(@raw_source)
         | 
| 254 | 
            +
                  unless Jpmobile::Util.extract_charset(_raw_source) == @charset
         | 
| 255 | 
            +
                    @charset = Jpmobile::Util.extract_charset(_raw_source)
         | 
| 256 | 
            +
                  end
         | 
| 242 257 | 
             
                  _raw_source = Jpmobile::Util.set_encoding(_raw_source, @charset)
         | 
| 243 258 | 
             
                  @raw_source = @mobile.decode_transfer_encoding(_raw_source, @charset)
         | 
| 244 259 | 
             
                end
         | 
| @@ -303,7 +318,6 @@ module Mail | |
| 303 318 |  | 
| 304 319 | 
             
              # for subject
         | 
| 305 320 | 
             
              class SubjectField < UnstructuredField
         | 
| 306 | 
            -
                # FIXME: not folding subject -> folding
         | 
| 307 321 | 
             
                def encoded_with_jpmobile
         | 
| 308 322 | 
             
                  if @mobile
         | 
| 309 323 | 
             
                    if @mobile.to_mail_subject_encoded?(value)
         | 
| @@ -321,6 +335,77 @@ module Mail | |
| 321 335 | 
             
                alias_method :encoded, :encoded_with_jpmobile
         | 
| 322 336 | 
             
              end
         | 
| 323 337 |  | 
| 338 | 
            +
              class StructuredField
         | 
| 339 | 
            +
                attr_accessor :mobile
         | 
| 340 | 
            +
              end
         | 
| 341 | 
            +
             | 
| 342 | 
            +
              class FromField < StructuredField
         | 
| 343 | 
            +
                def initialize_with_jpmobile(value = nil, charset = 'utf-8')
         | 
| 344 | 
            +
                  @jpmobile_raw_text = value
         | 
| 345 | 
            +
                  initialize_without_jpmobile(value, charset)
         | 
| 346 | 
            +
                end
         | 
| 347 | 
            +
             | 
| 348 | 
            +
                alias_method :initialize_without_jpmobile, :initialize
         | 
| 349 | 
            +
                alias_method :initialize, :initialize_with_jpmobile
         | 
| 350 | 
            +
             | 
| 351 | 
            +
                def mobile=(m)
         | 
| 352 | 
            +
                  if @mobile = m
         | 
| 353 | 
            +
                    self.charset = @mobile.mail_charset(@charset)
         | 
| 354 | 
            +
                    self.value = @jpmobile_raw_text
         | 
| 355 | 
            +
                    self.parse
         | 
| 356 | 
            +
                  end
         | 
| 357 | 
            +
                end
         | 
| 358 | 
            +
             | 
| 359 | 
            +
                def encoded_with_jpmobile
         | 
| 360 | 
            +
                  if @mobile
         | 
| 361 | 
            +
                    self.charset = @mobile.mail_charset(@charset)
         | 
| 362 | 
            +
                  end
         | 
| 363 | 
            +
             | 
| 364 | 
            +
                  encoded_without_jpmobile
         | 
| 365 | 
            +
                end
         | 
| 366 | 
            +
             | 
| 367 | 
            +
                alias_method :encoded_without_jpmobile, :encoded
         | 
| 368 | 
            +
                alias_method :encoded, :encoded_with_jpmobile
         | 
| 369 | 
            +
              end
         | 
| 370 | 
            +
             | 
| 371 | 
            +
              class ToField < StructuredField
         | 
| 372 | 
            +
                def initialize_with_jpmobile(value = nil, charset = 'utf-8')
         | 
| 373 | 
            +
                  @jpmobile_raw_text = value
         | 
| 374 | 
            +
                  initialize_without_jpmobile(value, charset)
         | 
| 375 | 
            +
                end
         | 
| 376 | 
            +
             | 
| 377 | 
            +
                alias_method :initialize_without_jpmobile, :initialize
         | 
| 378 | 
            +
                alias_method :initialize, :initialize_with_jpmobile
         | 
| 379 | 
            +
             | 
| 380 | 
            +
                def mobile=(m)
         | 
| 381 | 
            +
                  if @mobile = m
         | 
| 382 | 
            +
                    self.charset = @mobile.mail_charset(@charset)
         | 
| 383 | 
            +
                    self.value = @jpmobile_raw_text
         | 
| 384 | 
            +
                    self.parse
         | 
| 385 | 
            +
                  end
         | 
| 386 | 
            +
                end
         | 
| 387 | 
            +
             | 
| 388 | 
            +
                def encoded_with_jpmobile
         | 
| 389 | 
            +
                  if @mobile
         | 
| 390 | 
            +
                    self.charset = @mobile.mail_charset(@charset)
         | 
| 391 | 
            +
                  end
         | 
| 392 | 
            +
             | 
| 393 | 
            +
                  encoded_without_jpmobile
         | 
| 394 | 
            +
                end
         | 
| 395 | 
            +
             | 
| 396 | 
            +
                alias_method :encoded_without_jpmobile, :encoded
         | 
| 397 | 
            +
                alias_method :encoded, :encoded_with_jpmobile
         | 
| 398 | 
            +
              end
         | 
| 399 | 
            +
             | 
| 400 | 
            +
              class Address
         | 
| 401 | 
            +
                def encoded_with_jpmobile
         | 
| 402 | 
            +
                  encoded_without_jpmobile
         | 
| 403 | 
            +
                end
         | 
| 404 | 
            +
             | 
| 405 | 
            +
                alias_method :encoded_without_jpmobile, :encoded
         | 
| 406 | 
            +
                alias_method :encoded, :encoded_with_jpmobile
         | 
| 407 | 
            +
              end
         | 
| 408 | 
            +
             | 
| 324 409 | 
             
              class Sendmail
         | 
| 325 410 | 
             
                def Sendmail.call(path, arguments, destinations, mail)
         | 
| 326 411 | 
             
                  encoded_mail = mail.encoded
         | 
| @@ -102,7 +102,8 @@ module Jpmobile::Mobile | |
| 102 102 | 
             
                  to_mail_encoding(str)
         | 
| 103 103 | 
             
                end
         | 
| 104 104 | 
             
                def mail_charset(charset = nil)
         | 
| 105 | 
            -
                  (charset.nil? or charset == "") ? self.class::MAIL_CHARSET : charset
         | 
| 105 | 
            +
                  # (charset.nil? or charset == "") ? self.class::MAIL_CHARSET : charset
         | 
| 106 | 
            +
                  self.class::MAIL_CHARSET
         | 
| 106 107 | 
             
                end
         | 
| 107 108 | 
             
                def to_mail_encoding(str)
         | 
| 108 109 | 
             
                  str = Jpmobile::Emoticon.utf8_to_unicodecr(str)
         | 
    
        data/spec/unit/mail_spec.rb
    CHANGED
    
    | @@ -10,7 +10,7 @@ describe "Jpmobile::Mail" do | |
| 10 10 | 
             
                @mail         = Mail.new
         | 
| 11 11 | 
             
                @mail.subject = "万葉"
         | 
| 12 12 | 
             
                @mail.body    = "ほげ"
         | 
| 13 | 
            -
                @mail.from    = "info@jpmobile-rails.org"
         | 
| 13 | 
            +
                @mail.from    = "ちはやふる <info@jpmobile-rails.org>"
         | 
| 14 14 | 
             
              end
         | 
| 15 15 |  | 
| 16 16 | 
             
              context "Mail#to" do
         | 
| @@ -23,7 +23,7 @@ describe "Jpmobile::Mail" do | |
| 23 23 | 
             
                before(:each) do
         | 
| 24 24 | 
             
                  @mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
         | 
| 25 25 | 
             
                  @mail.mobile = @mobile
         | 
| 26 | 
            -
                  @mail.to = "info+to@jpmobile-rails.org"
         | 
| 26 | 
            +
                  @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 27 27 | 
             
                end
         | 
| 28 28 |  | 
| 29 29 | 
             
                context "to_s" do
         | 
| @@ -34,6 +34,18 @@ describe "Jpmobile::Mail" do | |
| 34 34 | 
             
                  it "should contain encoded body" do
         | 
| 35 35 | 
             
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
         | 
| 36 36 | 
             
                  end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                  it "should contain encoded from"do
         | 
| 39 | 
            +
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
         | 
| 40 | 
            +
                  end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                  it "should contain encoded to" do
         | 
| 43 | 
            +
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
         | 
| 44 | 
            +
                  end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                  it "should contain correct Content-Type:" do
         | 
| 47 | 
            +
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("charset=ISO-2022-JP"))))
         | 
| 48 | 
            +
                  end
         | 
| 37 49 | 
             
                end
         | 
| 38 50 | 
             
              end
         | 
| 39 51 |  | 
| @@ -41,7 +53,7 @@ describe "Jpmobile::Mail" do | |
| 41 53 | 
             
                before(:each) do
         | 
| 42 54 | 
             
                  @mobile = Jpmobile::Mobile::Docomo.new(nil, nil)
         | 
| 43 55 | 
             
                  @mail.mobile = @mobile
         | 
| 44 | 
            -
                  @mail.to = "info+to@jpmobile-rails.org"
         | 
| 56 | 
            +
                  @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 45 57 | 
             
                end
         | 
| 46 58 |  | 
| 47 59 | 
             
                context "to_s" do
         | 
| @@ -53,6 +65,14 @@ describe "Jpmobile::Mail" do | |
| 53 65 | 
             
                    @mail.to_s.should match(Regexp.escape(utf8_to_sjis("ほげ")))
         | 
| 54 66 | 
             
                  end
         | 
| 55 67 |  | 
| 68 | 
            +
                  it "should contain encoded from" do
         | 
| 69 | 
            +
                    @mail.to_s.should match(sjis_regexp("gr+CzYLigtOC6Q=="))
         | 
| 70 | 
            +
                  end
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                  it "should contain encoded to" do
         | 
| 73 | 
            +
                    @mail.to_s.should match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
         | 
| 74 | 
            +
                  end
         | 
| 75 | 
            +
             | 
| 56 76 | 
             
                  it "should contains encoded emoticon" do
         | 
| 57 77 | 
             
                    @mail.subject += ""
         | 
| 58 78 | 
             
                    @mail.body = "#{@mail.body}"
         | 
| @@ -67,7 +87,7 @@ describe "Jpmobile::Mail" do | |
| 67 87 | 
             
                before(:each) do
         | 
| 68 88 | 
             
                  @mobile = Jpmobile::Mobile::Au.new(nil, nil)
         | 
| 69 89 | 
             
                  @mail.mobile = @mobile
         | 
| 70 | 
            -
                  @mail.to = "info+to@jpmobile-rails.org"
         | 
| 90 | 
            +
                  @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 71 91 | 
             
                end
         | 
| 72 92 |  | 
| 73 93 | 
             
                context "to_s" do
         | 
| @@ -79,6 +99,14 @@ describe "Jpmobile::Mail" do | |
| 79 99 | 
             
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
         | 
| 80 100 | 
             
                  end
         | 
| 81 101 |  | 
| 102 | 
            +
                  it "should contain encoded from" do
         | 
| 103 | 
            +
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
         | 
| 104 | 
            +
                  end
         | 
| 105 | 
            +
             | 
| 106 | 
            +
                  it "should contain encoded to" do
         | 
| 107 | 
            +
                    ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
         | 
| 108 | 
            +
                  end
         | 
| 109 | 
            +
             | 
| 82 110 | 
             
                  it "should contain encoded emoticon" do
         | 
| 83 111 | 
             
                    @mail.subject += ""
         | 
| 84 112 | 
             
                    @mail.body = "#{@mail.body}"
         | 
| @@ -93,7 +121,7 @@ describe "Jpmobile::Mail" do | |
| 93 121 | 
             
                before(:each) do
         | 
| 94 122 | 
             
                  @mobile = Jpmobile::Mobile::Softbank.new(nil, nil)
         | 
| 95 123 | 
             
                  @mail.mobile = @mobile
         | 
| 96 | 
            -
                  @mail.to = "info+to@jpmobile-rails.org"
         | 
| 124 | 
            +
                  @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 97 125 | 
             
                end
         | 
| 98 126 |  | 
| 99 127 | 
             
                context "to_s" do
         | 
| @@ -105,6 +133,14 @@ describe "Jpmobile::Mail" do | |
| 105 133 | 
             
                    @mail.to_s.should match(Regexp.escape(utf8_to_sjis("ほげ")))
         | 
| 106 134 | 
             
                  end
         | 
| 107 135 |  | 
| 136 | 
            +
                  it "should contain encoded from" do
         | 
| 137 | 
            +
                    @mail.to_s.should match(sjis_regexp("gr+CzYLigtOC6Q=="))
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                  it "should contain encoded to" do
         | 
| 141 | 
            +
                    @mail.to_s.should match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
         | 
| 142 | 
            +
                  end
         | 
| 143 | 
            +
             | 
| 108 144 | 
             
                  it "should contains encoded emoticon" do
         | 
| 109 145 | 
             
                    @mail.subject += ""
         | 
| 110 146 | 
             
                    @mail.body = "#{@mail.body}"
         | 
| @@ -127,7 +163,7 @@ describe "Jpmobile::Mail" do | |
| 127 163 | 
             
                  before(:each) do
         | 
| 128 164 | 
             
                    @mobile = Jpmobile::Mobile::Docomo.new(nil, nil)
         | 
| 129 165 | 
             
                    @mail.mobile = @mobile
         | 
| 130 | 
            -
                    @mail.to = "info+to@jpmobile-rails.org"
         | 
| 166 | 
            +
                    @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 131 167 | 
             
                  end
         | 
| 132 168 |  | 
| 133 169 | 
             
                  it "should contain encoded subject" do
         | 
| @@ -144,7 +180,7 @@ describe "Jpmobile::Mail" do | |
| 144 180 | 
             
                  before(:each) do
         | 
| 145 181 | 
             
                    @mobile = Jpmobile::Mobile::Au.new(nil, nil)
         | 
| 146 182 | 
             
                    @mail.mobile = @mobile
         | 
| 147 | 
            -
                    @mail.to = "info+to@jpmobile-rails.org"
         | 
| 183 | 
            +
                    @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 148 184 | 
             
                  end
         | 
| 149 185 |  | 
| 150 186 | 
             
                  it "should contain encoded subject" do
         | 
| @@ -161,7 +197,7 @@ describe "Jpmobile::Mail" do | |
| 161 197 | 
             
                  before(:each) do
         | 
| 162 198 | 
             
                    @mobile = Jpmobile::Mobile::Softbank.new(nil, nil)
         | 
| 163 199 | 
             
                    @mail.mobile = @mobile
         | 
| 164 | 
            -
                    @mail.to = "info+to@jpmobile-rails.org"
         | 
| 200 | 
            +
                    @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 165 201 | 
             
                  end
         | 
| 166 202 |  | 
| 167 203 | 
             
                  it "should contain encoded subject" do
         | 
| @@ -178,7 +214,7 @@ describe "Jpmobile::Mail" do | |
| 178 214 | 
             
                  before(:each) do
         | 
| 179 215 | 
             
                    @mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
         | 
| 180 216 | 
             
                    @mail.mobile = @mobile
         | 
| 181 | 
            -
                    @mail.to = "info+to@jpmobile-rails.org"
         | 
| 217 | 
            +
                    @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
         | 
| 182 218 | 
             
                  end
         | 
| 183 219 |  | 
| 184 220 | 
             
                  context "to_s" do
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,8 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: jpmobile
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash: 1923831939
         | 
| 5 4 | 
             
              prerelease: 6
         | 
| 6 | 
            -
               | 
| 7 | 
            -
              - 1
         | 
| 8 | 
            -
              - 0
         | 
| 9 | 
            -
              - 0
         | 
| 10 | 
            -
              - pre
         | 
| 11 | 
            -
              - 5
         | 
| 12 | 
            -
              version: 1.0.0.pre.5
         | 
| 5 | 
            +
              version: 1.0.0.pre.6
         | 
| 13 6 | 
             
            platform: ruby
         | 
| 14 7 | 
             
            authors: 
         | 
| 15 8 | 
             
            - Yoji Shidara
         | 
| @@ -18,271 +11,196 @@ autorequire: | |
| 18 11 | 
             
            bindir: bin
         | 
| 19 12 | 
             
            cert_chain: []
         | 
| 20 13 |  | 
| 21 | 
            -
            date: 2011-06- | 
| 14 | 
            +
            date: 2011-06-27 00:00:00 +09:00
         | 
| 22 15 | 
             
            default_executable: 
         | 
| 23 16 | 
             
            dependencies: 
         | 
| 24 17 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 25 18 | 
             
              name: jeweler
         | 
| 26 | 
            -
               | 
| 19 | 
            +
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 27 20 | 
             
                none: false
         | 
| 28 21 | 
             
                requirements: 
         | 
| 29 22 | 
             
                - - ">="
         | 
| 30 23 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 31 | 
            -
                    hash: 3
         | 
| 32 | 
            -
                    segments: 
         | 
| 33 | 
            -
                    - 0
         | 
| 34 24 | 
             
                    version: "0"
         | 
| 35 | 
            -
              prerelease: false
         | 
| 36 25 | 
             
              type: :development
         | 
| 37 | 
            -
               | 
| 26 | 
            +
              prerelease: false
         | 
| 27 | 
            +
              version_requirements: *id001
         | 
| 38 28 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 39 29 | 
             
              name: rails
         | 
| 40 | 
            -
               | 
| 30 | 
            +
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 41 31 | 
             
                none: false
         | 
| 42 32 | 
             
                requirements: 
         | 
| 43 33 | 
             
                - - ">="
         | 
| 44 34 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 45 | 
            -
                    hash: 21
         | 
| 46 | 
            -
                    segments: 
         | 
| 47 | 
            -
                    - 3
         | 
| 48 | 
            -
                    - 0
         | 
| 49 | 
            -
                    - 9
         | 
| 50 35 | 
             
                    version: 3.0.9
         | 
| 51 | 
            -
              prerelease: false
         | 
| 52 36 | 
             
              type: :development
         | 
| 53 | 
            -
               | 
| 37 | 
            +
              prerelease: false
         | 
| 38 | 
            +
              version_requirements: *id002
         | 
| 54 39 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 55 40 | 
             
              name: rspec
         | 
| 56 | 
            -
               | 
| 41 | 
            +
              requirement: &id003 !ruby/object:Gem::Requirement 
         | 
| 57 42 | 
             
                none: false
         | 
| 58 43 | 
             
                requirements: 
         | 
| 59 44 | 
             
                - - ">="
         | 
| 60 45 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 61 | 
            -
                    hash: 23
         | 
| 62 | 
            -
                    segments: 
         | 
| 63 | 
            -
                    - 2
         | 
| 64 | 
            -
                    - 6
         | 
| 65 | 
            -
                    - 0
         | 
| 66 46 | 
             
                    version: 2.6.0
         | 
| 67 | 
            -
              prerelease: false
         | 
| 68 47 | 
             
              type: :development
         | 
| 69 | 
            -
               | 
| 48 | 
            +
              prerelease: false
         | 
| 49 | 
            +
              version_requirements: *id003
         | 
| 70 50 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 71 51 | 
             
              name: rspec-rails
         | 
| 72 | 
            -
               | 
| 52 | 
            +
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 73 53 | 
             
                none: false
         | 
| 74 54 | 
             
                requirements: 
         | 
| 75 55 | 
             
                - - ">="
         | 
| 76 56 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 77 | 
            -
                    hash: 23
         | 
| 78 | 
            -
                    segments: 
         | 
| 79 | 
            -
                    - 2
         | 
| 80 | 
            -
                    - 6
         | 
| 81 | 
            -
                    - 0
         | 
| 82 57 | 
             
                    version: 2.6.0
         | 
| 83 | 
            -
              prerelease: false
         | 
| 84 58 | 
             
              type: :development
         | 
| 85 | 
            -
               | 
| 59 | 
            +
              prerelease: false
         | 
| 60 | 
            +
              version_requirements: *id004
         | 
| 86 61 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 87 62 | 
             
              name: webrat
         | 
| 88 | 
            -
               | 
| 63 | 
            +
              requirement: &id005 !ruby/object:Gem::Requirement 
         | 
| 89 64 | 
             
                none: false
         | 
| 90 65 | 
             
                requirements: 
         | 
| 91 66 | 
             
                - - ">="
         | 
| 92 67 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 93 | 
            -
                    hash: 3
         | 
| 94 | 
            -
                    segments: 
         | 
| 95 | 
            -
                    - 0
         | 
| 96 68 | 
             
                    version: "0"
         | 
| 97 | 
            -
              prerelease: false
         | 
| 98 69 | 
             
              type: :development
         | 
| 99 | 
            -
               | 
| 70 | 
            +
              prerelease: false
         | 
| 71 | 
            +
              version_requirements: *id005
         | 
| 100 72 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 101 73 | 
             
              name: geokit
         | 
| 102 | 
            -
               | 
| 74 | 
            +
              requirement: &id006 !ruby/object:Gem::Requirement 
         | 
| 103 75 | 
             
                none: false
         | 
| 104 76 | 
             
                requirements: 
         | 
| 105 77 | 
             
                - - ">="
         | 
| 106 78 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 107 | 
            -
                    hash: 3
         | 
| 108 | 
            -
                    segments: 
         | 
| 109 | 
            -
                    - 0
         | 
| 110 79 | 
             
                    version: "0"
         | 
| 111 | 
            -
              prerelease: false
         | 
| 112 80 | 
             
              type: :development
         | 
| 113 | 
            -
               | 
| 81 | 
            +
              prerelease: false
         | 
| 82 | 
            +
              version_requirements: *id006
         | 
| 114 83 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 115 84 | 
             
              name: sqlite3-ruby
         | 
| 116 | 
            -
               | 
| 85 | 
            +
              requirement: &id007 !ruby/object:Gem::Requirement 
         | 
| 117 86 | 
             
                none: false
         | 
| 118 87 | 
             
                requirements: 
         | 
| 119 88 | 
             
                - - ">="
         | 
| 120 89 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 121 | 
            -
                    hash: 3
         | 
| 122 | 
            -
                    segments: 
         | 
| 123 | 
            -
                    - 0
         | 
| 124 90 | 
             
                    version: "0"
         | 
| 125 | 
            -
              prerelease: false
         | 
| 126 91 | 
             
              type: :development
         | 
| 127 | 
            -
               | 
| 92 | 
            +
              prerelease: false
         | 
| 93 | 
            +
              version_requirements: *id007
         | 
| 128 94 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 129 95 | 
             
              name: hpricot
         | 
| 130 | 
            -
               | 
| 96 | 
            +
              requirement: &id008 !ruby/object:Gem::Requirement 
         | 
| 131 97 | 
             
                none: false
         | 
| 132 98 | 
             
                requirements: 
         | 
| 133 99 | 
             
                - - ">="
         | 
| 134 100 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 135 | 
            -
                    hash: 3
         | 
| 136 | 
            -
                    segments: 
         | 
| 137 | 
            -
                    - 0
         | 
| 138 101 | 
             
                    version: "0"
         | 
| 139 | 
            -
              prerelease: false
         | 
| 140 102 | 
             
              type: :development
         | 
| 141 | 
            -
               | 
| 103 | 
            +
              prerelease: false
         | 
| 104 | 
            +
              version_requirements: *id008
         | 
| 142 105 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 143 106 | 
             
              name: jeweler
         | 
| 144 | 
            -
               | 
| 107 | 
            +
              requirement: &id009 !ruby/object:Gem::Requirement 
         | 
| 145 108 | 
             
                none: false
         | 
| 146 109 | 
             
                requirements: 
         | 
| 147 110 | 
             
                - - ">="
         | 
| 148 111 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 149 | 
            -
                    hash: 1
         | 
| 150 | 
            -
                    segments: 
         | 
| 151 | 
            -
                    - 1
         | 
| 152 | 
            -
                    - 5
         | 
| 153 | 
            -
                    - 1
         | 
| 154 112 | 
             
                    version: 1.5.1
         | 
| 155 | 
            -
              prerelease: false
         | 
| 156 113 | 
             
              type: :development
         | 
| 157 | 
            -
               | 
| 114 | 
            +
              prerelease: false
         | 
| 115 | 
            +
              version_requirements: *id009
         | 
| 158 116 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 159 117 | 
             
              name: rspec
         | 
| 160 | 
            -
               | 
| 118 | 
            +
              requirement: &id010 !ruby/object:Gem::Requirement 
         | 
| 161 119 | 
             
                none: false
         | 
| 162 120 | 
             
                requirements: 
         | 
| 163 121 | 
             
                - - ">="
         | 
| 164 122 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 165 | 
            -
                    hash: 3
         | 
| 166 | 
            -
                    segments: 
         | 
| 167 | 
            -
                    - 2
         | 
| 168 | 
            -
                    - 3
         | 
| 169 | 
            -
                    - 0
         | 
| 170 123 | 
             
                    version: 2.3.0
         | 
| 171 | 
            -
              prerelease: false
         | 
| 172 124 | 
             
              type: :development
         | 
| 173 | 
            -
               | 
| 125 | 
            +
              prerelease: false
         | 
| 126 | 
            +
              version_requirements: *id010
         | 
| 174 127 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 175 128 | 
             
              name: rspec-rails
         | 
| 176 | 
            -
               | 
| 129 | 
            +
              requirement: &id011 !ruby/object:Gem::Requirement 
         | 
| 177 130 | 
             
                none: false
         | 
| 178 131 | 
             
                requirements: 
         | 
| 179 132 | 
             
                - - ">="
         | 
| 180 133 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 181 | 
            -
                    hash: 3
         | 
| 182 | 
            -
                    segments: 
         | 
| 183 | 
            -
                    - 2
         | 
| 184 | 
            -
                    - 3
         | 
| 185 | 
            -
                    - 0
         | 
| 186 134 | 
             
                    version: 2.3.0
         | 
| 187 | 
            -
              prerelease: false
         | 
| 188 135 | 
             
              type: :development
         | 
| 189 | 
            -
               | 
| 136 | 
            +
              prerelease: false
         | 
| 137 | 
            +
              version_requirements: *id011
         | 
| 190 138 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 191 139 | 
             
              name: webrat
         | 
| 192 | 
            -
               | 
| 140 | 
            +
              requirement: &id012 !ruby/object:Gem::Requirement 
         | 
| 193 141 | 
             
                none: false
         | 
| 194 142 | 
             
                requirements: 
         | 
| 195 143 | 
             
                - - ">="
         | 
| 196 144 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 197 | 
            -
                    hash: 7
         | 
| 198 | 
            -
                    segments: 
         | 
| 199 | 
            -
                    - 0
         | 
| 200 | 
            -
                    - 7
         | 
| 201 | 
            -
                    - 2
         | 
| 202 145 | 
             
                    version: 0.7.2
         | 
| 203 | 
            -
              prerelease: false
         | 
| 204 146 | 
             
              type: :development
         | 
| 205 | 
            -
               | 
| 147 | 
            +
              prerelease: false
         | 
| 148 | 
            +
              version_requirements: *id012
         | 
| 206 149 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 207 150 | 
             
              name: geokit
         | 
| 208 | 
            -
               | 
| 151 | 
            +
              requirement: &id013 !ruby/object:Gem::Requirement 
         | 
| 209 152 | 
             
                none: false
         | 
| 210 153 | 
             
                requirements: 
         | 
| 211 154 | 
             
                - - ">="
         | 
| 212 155 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 213 | 
            -
                    hash: 3
         | 
| 214 | 
            -
                    segments: 
         | 
| 215 | 
            -
                    - 1
         | 
| 216 | 
            -
                    - 5
         | 
| 217 | 
            -
                    - 0
         | 
| 218 156 | 
             
                    version: 1.5.0
         | 
| 219 | 
            -
              prerelease: false
         | 
| 220 157 | 
             
              type: :development
         | 
| 221 | 
            -
               | 
| 158 | 
            +
              prerelease: false
         | 
| 159 | 
            +
              version_requirements: *id013
         | 
| 222 160 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 223 161 | 
             
              name: sqlite3-ruby
         | 
| 224 | 
            -
               | 
| 162 | 
            +
              requirement: &id014 !ruby/object:Gem::Requirement 
         | 
| 225 163 | 
             
                none: false
         | 
| 226 164 | 
             
                requirements: 
         | 
| 227 165 | 
             
                - - ">="
         | 
| 228 166 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 229 | 
            -
                    hash: 31
         | 
| 230 | 
            -
                    segments: 
         | 
| 231 | 
            -
                    - 1
         | 
| 232 | 
            -
                    - 3
         | 
| 233 | 
            -
                    - 2
         | 
| 234 167 | 
             
                    version: 1.3.2
         | 
| 235 | 
            -
              prerelease: false
         | 
| 236 168 | 
             
              type: :development
         | 
| 237 | 
            -
               | 
| 169 | 
            +
              prerelease: false
         | 
| 170 | 
            +
              version_requirements: *id014
         | 
| 238 171 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 239 172 | 
             
              name: hpricot
         | 
| 240 | 
            -
               | 
| 173 | 
            +
              requirement: &id015 !ruby/object:Gem::Requirement 
         | 
| 241 174 | 
             
                none: false
         | 
| 242 175 | 
             
                requirements: 
         | 
| 243 176 | 
             
                - - ">="
         | 
| 244 177 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 245 | 
            -
                    hash: 57
         | 
| 246 | 
            -
                    segments: 
         | 
| 247 | 
            -
                    - 0
         | 
| 248 | 
            -
                    - 8
         | 
| 249 | 
            -
                    - 3
         | 
| 250 178 | 
             
                    version: 0.8.3
         | 
| 251 | 
            -
              prerelease: false
         | 
| 252 179 | 
             
              type: :development
         | 
| 253 | 
            -
               | 
| 180 | 
            +
              prerelease: false
         | 
| 181 | 
            +
              version_requirements: *id015
         | 
| 254 182 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 255 183 | 
             
              name: git
         | 
| 256 | 
            -
               | 
| 184 | 
            +
              requirement: &id016 !ruby/object:Gem::Requirement 
         | 
| 257 185 | 
             
                none: false
         | 
| 258 186 | 
             
                requirements: 
         | 
| 259 187 | 
             
                - - ">="
         | 
| 260 188 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 261 | 
            -
                    hash: 21
         | 
| 262 | 
            -
                    segments: 
         | 
| 263 | 
            -
                    - 1
         | 
| 264 | 
            -
                    - 2
         | 
| 265 | 
            -
                    - 5
         | 
| 266 189 | 
             
                    version: 1.2.5
         | 
| 267 | 
            -
              prerelease: false
         | 
| 268 190 | 
             
              type: :development
         | 
| 269 | 
            -
               | 
| 191 | 
            +
              prerelease: false
         | 
| 192 | 
            +
              version_requirements: *id016
         | 
| 270 193 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 271 194 | 
             
              name: rails
         | 
| 272 | 
            -
               | 
| 195 | 
            +
              requirement: &id017 !ruby/object:Gem::Requirement 
         | 
| 273 196 | 
             
                none: false
         | 
| 274 197 | 
             
                requirements: 
         | 
| 275 198 | 
             
                - - ">="
         | 
| 276 199 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 277 | 
            -
                    hash: 1
         | 
| 278 | 
            -
                    segments: 
         | 
| 279 | 
            -
                    - 3
         | 
| 280 | 
            -
                    - 0
         | 
| 281 | 
            -
                    - 3
         | 
| 282 200 | 
             
                    version: 3.0.3
         | 
| 283 | 
            -
              prerelease: false
         | 
| 284 201 | 
             
              type: :development
         | 
| 285 | 
            -
               | 
| 202 | 
            +
              prerelease: false
         | 
| 203 | 
            +
              version_requirements: *id017
         | 
| 286 204 | 
             
            description: A Rails plugin for Japanese mobile-phones
         | 
| 287 205 | 
             
            email: dara@shidara.net
         | 
| 288 206 | 
             
            executables: []
         | 
| @@ -501,20 +419,12 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 501 419 | 
             
              requirements: 
         | 
| 502 420 | 
             
              - - ">="
         | 
| 503 421 | 
             
                - !ruby/object:Gem::Version 
         | 
| 504 | 
            -
                  hash: 3
         | 
| 505 | 
            -
                  segments: 
         | 
| 506 | 
            -
                  - 0
         | 
| 507 422 | 
             
                  version: "0"
         | 
| 508 423 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 509 424 | 
             
              none: false
         | 
| 510 425 | 
             
              requirements: 
         | 
| 511 426 | 
             
              - - ">"
         | 
| 512 427 | 
             
                - !ruby/object:Gem::Version 
         | 
| 513 | 
            -
                  hash: 25
         | 
| 514 | 
            -
                  segments: 
         | 
| 515 | 
            -
                  - 1
         | 
| 516 | 
            -
                  - 3
         | 
| 517 | 
            -
                  - 1
         | 
| 518 428 | 
             
                  version: 1.3.1
         | 
| 519 429 | 
             
            requirements: []
         | 
| 520 430 |  |