mms2r 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_helper.rb CHANGED
@@ -40,7 +40,7 @@ module MMS2R
40
40
  Mail.read(mail_fixture(name))
41
41
  end
42
42
 
43
- def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', jpeg = true)
43
+ def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true)
44
44
  mail = stub('mail',
45
45
  :from => ['joe@example.com'],
46
46
  :return_path => '<joe@example.com>',
@@ -55,7 +55,7 @@ module MMS2R
55
55
  :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" )
56
56
 
57
57
  mail.stubs(:parts).returns([part])
58
- exif = stub('exif', :make => make_text, :model => model_text)
58
+ exif = stub('exif', :make => make_text, :model => model_text, :software => software_text)
59
59
  if jpeg
60
60
  EXIFR::JPEG.expects(:new).at_least_once.returns(exif)
61
61
  else
@@ -769,19 +769,40 @@ class TestMms2rMedia < Test::Unit::TestCase
769
769
  end
770
770
 
771
771
  def test_faux_tiff_iphone_device_type_by_exif
772
- mail = smart_phone_mock('Apple', 'iPhone', jpeg = false)
772
+ mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false)
773
773
  mms = MMS2R::Media.new(mail)
774
774
  assert_equal :iphone, mms.device_type?
775
775
  assert_equal true, mms.is_mobile?
776
776
  end
777
777
 
778
- def test_blackberry_device_type_by_exif
778
+ def test_iphone_device_type_by_filename_jpg
779
+ mail = smart_phone_mock('Hipstamatic', '201')
780
+ mms = MMS2R::Media.new(mail)
781
+ assert_equal :apple, mms.device_type?
782
+ assert_equal true, mms.is_mobile?
783
+ end
784
+
785
+ def test_iphone_device_type_by_filename_png
786
+ mail = mail('iphone-image-02.mail')
787
+ mms = MMS2R::Media.new(mail)
788
+ assert_equal true, mms.is_mobile?
789
+ assert_equal :iphone, mms.device_type?
790
+ end
791
+
792
+ def test_blackberry_device_type_by_exif_make_model
779
793
  mail = smart_phone_mock('Research In Motion', 'BlackBerry')
780
794
  mms = MMS2R::Media.new(mail)
781
795
  assert_equal :blackberry, mms.device_type?
782
796
  assert_equal true, mms.is_mobile?
783
797
  end
784
798
 
799
+ def test_blackberry_device_type_by_exif_software
800
+ mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a")
801
+ mms = MMS2R::Media.new(mail)
802
+ assert_equal :blackberry, mms.device_type?
803
+ assert_equal true, mms.is_mobile?
804
+ end
805
+
785
806
  def test_dash_device_type_by_exif
786
807
  mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash')
787
808
  mms = MMS2R::Media.new(mail)
@@ -810,6 +831,13 @@ class TestMms2rMedia < Test::Unit::TestCase
810
831
  assert_equal true, mms.is_mobile?
811
832
  end
812
833
 
834
+ def test_android_app_by_exif
835
+ mail = smart_phone_mock('Retro Camera Android', "Xoloroid 2000")
836
+ mms = MMS2R::Media.new(mail)
837
+ assert_equal :android, mms.device_type?
838
+ assert_equal true, mms.is_mobile?
839
+ end
840
+
813
841
  def test_handsets_by_exif
814
842
  handsets = YAML.load_file(fixture('handsets.yml'))
815
843
  handsets.each do |handset|
@@ -0,0 +1,18 @@
1
+ require "test_helper"
2
+
3
+ class Testprint < Test::Unit::TestCase
4
+ include MMS2R::TestHelper
5
+
6
+ def test_sprint_blackberry_01
7
+ # Rim Exif Version1.00a
8
+ mail = mail('sprint-blackberry-01.mail')
9
+ mms = MMS2R::Media.new(mail)
10
+ assert_equal true, mms.is_mobile?
11
+ assert_equal :blackberry, mms.device_type?
12
+ assert_equal "", mms.body
13
+ assert_equal 1, mms.media.size
14
+ assert_equal 1, mms.media['image/jpeg'].size
15
+
16
+ mms.purge
17
+ end
18
+ end
metadata CHANGED
@@ -1,109 +1,131 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mms2r
3
- version: !ruby/object:Gem::Version
4
- version: 3.4.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 3
8
+ - 4
9
+ - 1
10
+ version: 3.4.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Mike Mondragon
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-10-31 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-11-06 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: nokogiri
16
- requirement: &13599080 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 15
29
+ segments:
30
+ - 1
31
+ - 4
32
+ - 4
21
33
  version: 1.4.4
22
34
  type: :runtime
23
- prerelease: false
24
- version_requirements: *13599080
25
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
26
37
  name: mail
27
- requirement: &13597440 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 19
45
+ segments:
46
+ - 2
47
+ - 2
48
+ - 10
32
49
  version: 2.2.10
33
50
  type: :runtime
34
- prerelease: false
35
- version_requirements: *13597440
36
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
37
53
  name: uuidtools
38
- requirement: &13594060 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
39
56
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 9
61
+ segments:
62
+ - 2
63
+ - 1
64
+ - 1
43
65
  version: 2.1.1
44
66
  type: :runtime
45
- prerelease: false
46
- version_requirements: *13594060
47
- - !ruby/object:Gem::Dependency
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
48
69
  name: exifr
49
- requirement: &13553800 !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
50
72
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 17
77
+ segments:
78
+ - 1
79
+ - 0
80
+ - 3
54
81
  version: 1.0.3
55
82
  type: :runtime
56
- prerelease: false
57
- version_requirements: *13553800
58
- - !ruby/object:Gem::Dependency
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
59
85
  name: hoe
60
- requirement: &13551820 !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
61
88
  none: false
62
- requirements:
89
+ requirements:
63
90
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '2.12'
91
+ - !ruby/object:Gem::Version
92
+ hash: 27
93
+ segments:
94
+ - 2
95
+ - 12
96
+ version: "2.12"
66
97
  type: :development
67
- prerelease: false
68
- version_requirements: *13551820
69
- description: ! '== DESCRIPTION
70
-
71
-
98
+ version_requirements: *id005
99
+ description: |-
100
+ == DESCRIPTION
101
+
72
102
  MMS2R by Mike Mondragon
73
-
74
103
  http://mms2r.rubyforge.org/
75
-
76
104
  https://github.com/monde/mms2r
77
-
78
105
  https://github.com/monde/mms2r/issues
79
-
80
106
  http://peepcode.com/products/mms2r-pdf
81
-
82
-
107
+
83
108
  MMS2R is a library that decodes the parts of an MMS message to disk while
84
-
85
109
  stripping out advertising injected by the mobile carriers. MMS messages are
86
-
87
110
  multipart email and the carriers often inject branding into these messages. Use
88
-
89
111
  MMS2R if you want to get at the real user generated content from a MMS without
90
-
91
112
  having to deal with the cruft from the carriers.
92
-
93
-
113
+
94
114
  If MMS2R is not aware of a particular carrier no extra processing is done to the
95
-
96
- MMS other than decoding and consolidating its media.'
97
- email:
115
+ MMS other than decoding and consolidating its media.
116
+ email:
98
117
  - mikemondragon@gmail.com
99
118
  executables: []
119
+
100
120
  extensions: []
101
- extra_rdoc_files:
121
+
122
+ extra_rdoc_files:
102
123
  - History.txt
103
124
  - Manifest.txt
104
125
  - README.TMail.txt
105
126
  - README.txt
106
- files:
127
+ files:
128
+ - .gitignore
107
129
  - Gemfile
108
130
  - Gemfile.lock
109
131
  - History.txt
@@ -130,7 +152,7 @@ files:
130
152
  - conf/mms.netcom.no.yml
131
153
  - conf/mms.o2online.de.yml
132
154
  - conf/mms.three.co.uk.yml
133
- - conf/mms.uscc.net.mail
155
+ - conf/mms.uscc.net.yml
134
156
  - conf/mms.vodacom4me.co.za.yml
135
157
  - conf/mms2r_media.yml
136
158
  - conf/mobile.indosat.net.id.yml
@@ -188,6 +210,7 @@ files:
188
210
  - test/fixtures/indosat-image-02.mail
189
211
  - test/fixtures/info2go-image-01.mail
190
212
  - test/fixtures/iphone-image-01.mail
213
+ - test/fixtures/iphone-image-02.mail
191
214
  - test/fixtures/luxgsm-image-01.mail
192
215
  - test/fixtures/maroctelecom-france-mms-01.mail
193
216
  - test/fixtures/mediamessaging_o2_co_uk-image-01.mail
@@ -213,6 +236,7 @@ files:
213
236
  - test/fixtures/pxt-image-01.mail
214
237
  - test/fixtures/rogers-canada-mms-01.mail
215
238
  - test/fixtures/sasktel-image-01.mail
239
+ - test/fixtures/sprint-blackberry-01.mail
216
240
  - test/fixtures/sprint-broken-image-01.mail
217
241
  - test/fixtures/sprint-image-01.mail
218
242
  - test/fixtures/sprint-new-image-01.mail
@@ -247,7 +271,6 @@ files:
247
271
  - test/fixtures/vtext-text-01.mail
248
272
  - test/fixtures/vzwpix.com-image-01.mail
249
273
  - test/fixtures/waw.plspictures.com-image-01.mail
250
- - test/hax.rb
251
274
  - test/test_1nbox_net.rb
252
275
  - test/test_bell_canada.rb
253
276
  - test/test_bellsouth_net.rb
@@ -278,6 +301,7 @@ files:
278
301
  - test/test_pxt_vodafone_net_nz.rb
279
302
  - test/test_rci_rogers_com.rb
280
303
  - test/test_sms_sasktel_com.rb
304
+ - test/test_sprint.rb
281
305
  - test/test_tmomail_net.rb
282
306
  - test/test_unicel_com.rb
283
307
  - test/test_vmpix_com.rb
@@ -288,34 +312,39 @@ files:
288
312
  - .gemtest
289
313
  homepage: https://github.com/monde/mms2r
290
314
  licenses: []
315
+
291
316
  post_install_message:
292
- rdoc_options:
317
+ rdoc_options:
293
318
  - --main
294
319
  - README.txt
295
- require_paths:
320
+ require_paths:
296
321
  - lib
297
- required_ruby_version: !ruby/object:Gem::Requirement
322
+ required_ruby_version: !ruby/object:Gem::Requirement
298
323
  none: false
299
- requirements:
300
- - - ! '>='
301
- - !ruby/object:Gem::Version
302
- version: '0'
303
- segments:
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ hash: 3
328
+ segments:
304
329
  - 0
305
- hash: 4582879088238575309
306
- required_rubygems_version: !ruby/object:Gem::Requirement
330
+ version: "0"
331
+ required_rubygems_version: !ruby/object:Gem::Requirement
307
332
  none: false
308
- requirements:
309
- - - ! '>='
310
- - !ruby/object:Gem::Version
311
- version: '0'
333
+ requirements:
334
+ - - ">="
335
+ - !ruby/object:Gem::Version
336
+ hash: 3
337
+ segments:
338
+ - 0
339
+ version: "0"
312
340
  requirements: []
341
+
313
342
  rubyforge_project: mms2r
314
343
  rubygems_version: 1.8.10
315
344
  signing_key:
316
345
  specification_version: 3
317
346
  summary: Extract user media from MMS (and not carrier cruft)
318
- test_files:
347
+ test_files:
319
348
  - test/test_orangemms_net.rb
320
349
  - test/test_waw_plspictures_com.rb
321
350
  - test/test_mediamessaging_o2_co_uk.rb
@@ -350,4 +379,5 @@ test_files:
350
379
  - test/test_mms_three_co_uk.rb
351
380
  - test/test_vmpix_com.rb
352
381
  - test/test_mms_myhelio_com.rb
382
+ - test/test_sprint.rb
353
383
  - test/test_mms_ae.rb
data/test/hax.rb DELETED
@@ -1,8 +0,0 @@
1
- #regexp = "/^([^\s|^\/|^@]+).*/"
2
- regexp = "^@"
3
- pattern = Regexp.escape(regexp)
4
-
5
- Dir.glob(File.join(File.dirname(__FILE__), "../conf/*yml")).each do |f|
6
- content = open(f).read
7
- puts f if (/#{pattern}/mi).match(content)
8
- end