mms2r 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ class MMS2RVerizonTest < Test::Unit::TestCase
19
19
 
20
20
  def test_simple_video
21
21
  mail = TMail::Mail.parse(load_mail('verizon-video-01.mail').join)
22
- mms = MMS2R::Media.create(mail,@logger)
22
+ mms = MMS2R::Media.create(mail)
23
23
  mms.process
24
24
 
25
25
  assert(mms.media.size == 1)
@@ -37,7 +37,7 @@ class MMS2RVerizonTest < Test::Unit::TestCase
37
37
 
38
38
  def test_simple_image
39
39
  mail = TMail::Mail.parse(load_mail('verizon-image-01.mail').join)
40
- mms = MMS2R::Media.create(mail,@logger)
40
+ mms = MMS2R::Media.create(mail)
41
41
  mms.process
42
42
 
43
43
  assert(mms.media.size == 1)
@@ -49,7 +49,7 @@ class MMS2RVerizonTest < Test::Unit::TestCase
49
49
  file = mms.media['image/jpeg'][0]
50
50
  assert_not_nil(file)
51
51
  assert(File::exist?(file), "file #{file} does not exist")
52
- assert(File::size(file) == 41983, "file #{file} not 41983 byts")
52
+ assert(File::size(file) == 337, "file #{file} not 41983 byts")
53
53
  mms.purge
54
54
  end
55
55
 
@@ -67,8 +67,22 @@ class MMS2RVerizonTest < Test::Unit::TestCase
67
67
  mms.purge
68
68
  end
69
69
 
70
+ def test_simple_text_vtext
71
+ mail = TMail::Mail.parse(load_mail('vtext-text-01.mail').join)
72
+ mms = MMS2R::Media.create(mail)
73
+ assert_equal(MMS2R::VerizonMedia, mms.class, "expected a #{MMS2R::VerizonMedia} and received a #{mms.class}")
74
+ mms.process
75
+ assert_not_nil(mms.media['text/plain'])
76
+ file = mms.media['text/plain'][0]
77
+ assert_not_nil(file)
78
+ assert(File::exist?(file), "file #{file} does not exist")
79
+ text = IO.readlines("#{file}").join
80
+ assert_match(/hello world/, text)
81
+ mms.purge
82
+ end
83
+
70
84
  private
71
- def load_mail(file)
72
- IO.readlines("#{File.dirname(__FILE__)}/files/#{file}")
73
- end
85
+ def load_mail(file)
86
+ IO.readlines("#{File.dirname(__FILE__)}/files/#{file}")
87
+ end
74
88
  end
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: mms2r
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2007-03-06 00:00:00 -08:00
6
+ version: 1.0.2
7
+ date: 2007-03-07 00:00:00 -08:00
8
8
  summary: Extract media from MMS
9
9
  require_paths:
10
10
  - lib
11
11
  email: mike@mondragon.cc
12
12
  homepage:
13
13
  rubyforge_project: mms2r
14
- description: "http://mms2r.rubyforge.org/ == DESCRIPTION: MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the cellphone carriers. MMS messages are multipart email and the carriers often inject branding into these messages. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. Contact the author to add additional carriers to be processed by the library."
14
+ description: "http://mms2r.rubyforge.org/ == DESCRIPTION: MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the cellphone carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the garbage from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. Contact the author to add additional carriers to be processed by the library. Corpus of carriers currently processed by MMS2R: * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Cingular => cingularme.com * Nextel => messaging.nextel.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com * Verizon => vtext.com == FEATURES/PROBLEMS:"
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -34,6 +34,7 @@ files:
34
34
  - README.txt
35
35
  - Rakefile
36
36
  - conf/mms2r_cingularmedia_transform.yml
37
+ - conf/mms2r_nextelmedia_ignore.yml
37
38
  - conf/mms2r_sprintmedia_ignore.yml
38
39
  - conf/mms2r_tmobilemedia_ignore.yml
39
40
  - conf/mms2r_verizonmedia_ignore.yml
@@ -41,6 +42,7 @@ files:
41
42
  - lib/mms2r/cingular_media.rb
42
43
  - lib/mms2r/media.rb
43
44
  - lib/mms2r/mmode_media.rb
45
+ - lib/mms2r/nextel_media.rb
44
46
  - lib/mms2r/sprint_media.rb
45
47
  - lib/mms2r/tmobile_media.rb
46
48
  - lib/mms2r/verizon_media.rb
@@ -69,17 +71,28 @@ files:
69
71
  - lib/vendor/tmail/stringio.rb
70
72
  - lib/vendor/tmail/tmail.rb
71
73
  - lib/vendor/tmail/utils.rb
74
+ - test/files/cingularme-text-01.mail
72
75
  - test/files/dot.jpg
76
+ - test/files/hello_world_mail_multipart.mail
77
+ - test/files/hello_world_mail_plain_no_content_type.mail
78
+ - test/files/hello_world_mail_plain_with_content_type.mail
79
+ - test/files/mmode-image-01.mail
80
+ - test/files/nextel-image-01.mail
81
+ - test/files/simple_image.mail
82
+ - test/files/simple_multipart_alternative.mail
73
83
  - test/files/sprint-image-01.mail
74
84
  - test/files/sprint-text-01.mail
75
85
  - test/files/sprint-video-01.mail
76
86
  - test/files/sprint.mov
87
+ - test/files/tmobile-image-01.mail
77
88
  - test/files/verizon-image-01.mail
78
89
  - test/files/verizon-text-01.mail
79
90
  - test/files/verizon-video-01.mail
91
+ - test/files/vtext-text-01.mail
80
92
  - test/test_mms2r_cingular.rb
81
93
  - test/test_mms2r_media.rb
82
94
  - test/test_mms2r_mmode.rb
95
+ - test/test_mms2r_nextel.rb
83
96
  - test/test_mms2r_sprint.rb
84
97
  - test/test_mms2r_tmobile.rb
85
98
  - test/test_mms2r_verizon.rb
@@ -90,6 +103,7 @@ test_files:
90
103
  - test/test_mms2r_verizon.rb
91
104
  - test/test_mms2r_sprint.rb
92
105
  - test/test_mms2r_mmode.rb
106
+ - test/test_mms2r_nextel.rb
93
107
  rdoc_options: []
94
108
 
95
109
  extra_rdoc_files: []