mms2r 3.3.1 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/.gemtest +0 -0
  2. data/Gemfile +11 -11
  3. data/Gemfile.lock +28 -24
  4. data/History.txt +7 -0
  5. data/Manifest.txt +5 -4
  6. data/README.txt +8 -5
  7. data/conf/1nbox.net.yml +4 -4
  8. data/conf/aliases.yml +1 -1
  9. data/conf/mediamessaging.o2.co.uk.yml +1 -1
  10. data/conf/messaging.nextel.com.yml +8 -8
  11. data/conf/mms.3ireland.ie.yml +8 -8
  12. data/conf/mms.ae.yml +1 -1
  13. data/conf/mms.alltel.com.yml +2 -2
  14. data/conf/mms.att.net.yml +9 -9
  15. data/conf/mms.dobson.net.yml +3 -3
  16. data/conf/mms.luxgsm.lu.yml +8 -8
  17. data/conf/mms.mobileiam.ma.yml +6 -6
  18. data/conf/mms.mtn.co.za.yml +4 -4
  19. data/conf/mms.myhelio.com.yml +7 -7
  20. data/conf/mms.netcom.no.yml +2 -2
  21. data/conf/mms.o2online.de.yml +6 -6
  22. data/conf/mms.three.co.uk.yml +9 -9
  23. data/conf/mms.uscc.net.mail +6 -6
  24. data/conf/mms.vodacom4me.co.za.yml +4 -4
  25. data/conf/mms2r_media.yml +20 -20
  26. data/conf/mobile.indosat.net.id.yml +4 -4
  27. data/conf/msg.telus.com.yml +2 -2
  28. data/conf/orangemms.net.yml +7 -7
  29. data/conf/pm.sprint.com.yml +8 -8
  30. data/conf/pxt.vodafone.net.nz.yml +3 -3
  31. data/conf/rci.rogers.com.yml +7 -7
  32. data/conf/sms.sasktel.com.yml +9 -9
  33. data/conf/tmomail.net.yml +22 -22
  34. data/conf/txt.bell.ca.yml +2 -2
  35. data/conf/unicel.com.yml +3 -3
  36. data/conf/vmpix.com.yml +7 -7
  37. data/conf/vzwpix.com.yml +6 -6
  38. data/conf/waw.plspictures.com.yml +8 -9
  39. data/dev_tools/anonymizer.rb +1 -1
  40. data/lib/{mail_ext.rb → ext/mail.rb} +0 -0
  41. data/lib/ext/object.rb +11 -0
  42. data/lib/mms2r.rb +10 -20
  43. data/lib/mms2r/media.rb +33 -29
  44. data/mms2r.gemspec +23 -43
  45. data/test/fixtures/ad_new.txt +5 -0
  46. data/test/fixtures/dici_un_mois_georgie.txt +1 -0
  47. data/test/hax.rb +8 -0
  48. data/test/test_1nbox_net.rb +2 -2
  49. data/test/test_bell_canada.rb +1 -1
  50. data/test/test_bellsouth_net.rb +2 -2
  51. data/test/test_helper.rb +5 -9
  52. data/test/test_mediamessaging_o2_co_uk.rb +1 -1
  53. data/test/test_messaging_nextel_com.rb +1 -1
  54. data/test/test_messaging_sprintpcs_com.rb +1 -1
  55. data/test/test_mms2r_media.rb +35 -23
  56. data/test/test_mms_3ireland_ie.rb +1 -1
  57. data/test/test_mms_ae.rb +1 -1
  58. data/test/test_mms_alltel_com.rb +1 -1
  59. data/test/test_mms_att_net.rb +2 -2
  60. data/test/test_mms_dobson_net.rb +1 -1
  61. data/test/test_mms_luxgsm_lu.rb +1 -1
  62. data/test/test_mms_mobileiam_ma.rb +1 -1
  63. data/test/test_mms_mtn_co_za.rb +1 -1
  64. data/test/test_mms_mycricket_com.rb +1 -1
  65. data/test/test_mms_myhelio_com.rb +1 -1
  66. data/test/test_mms_netcom_no.rb +1 -1
  67. data/test/test_mms_o2online_de.rb +1 -1
  68. data/test/test_mms_three_co_uk.rb +1 -1
  69. data/test/test_mms_uscc_net.rb +1 -1
  70. data/test/test_mms_vodacom4me_co_za.rb +1 -1
  71. data/test/test_mobile_indosat_net_id.rb +1 -1
  72. data/test/test_msg_telus_com.rb +1 -1
  73. data/test/test_orangemms_net.rb +1 -1
  74. data/test/test_pm_sprint_com.rb +1 -1
  75. data/test/test_pxt_vodafone_net_nz.rb +1 -1
  76. data/test/test_rci_rogers_com.rb +1 -1
  77. data/test/test_sms_sasktel_com.rb +1 -1
  78. data/test/test_tmomail_net.rb +4 -4
  79. data/test/test_unicel_com.rb +1 -1
  80. data/test/test_vmpix_com.rb +1 -1
  81. data/test/test_vzwpix_com.rb +3 -7
  82. data/test/test_waw_plspictures_com.rb +1 -1
  83. metadata +91 -118
  84. data/.gitignore +0 -7
  85. data/dev_tools/github.rb +0 -8
  86. data/test/test_github.rb +0 -12
File without changes
data/Gemfile CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  source :gemcutter
4
4
 
5
- gem "nokogiri", ">=1.4.4"
6
- gem "mail", ">=2.2.10"
7
- gem "uuidtools", ">=2.1.1"
8
- gem "exifr", ">=1.0.3"
5
+ gem "nokogiri"
6
+ gem "mail"
7
+ gem "exifr"
9
8
 
10
- gem "rubyforge", ">=2.0.4", :group => [:development, :test]
11
- gem "gemcutter", ">=0.4.1", :group => [:development, :test]
12
- gem "hoe", ">=2.5.0", :group => [:development, :test]
13
-
14
- group :test do
15
- gem 'test-unit', '= 1.2.3'
16
- gem 'mocha'
9
+ group :development, :test do
10
+ gem "rdoc"
11
+ gem "rubyforge"
12
+ gem "gemcutter"
13
+ gem "hoe"
14
+ gem "rcov"
15
+ gem "test-unit", "=1.2.3"
16
+ gem "mocha"
17
17
  end
18
18
 
19
19
  # vim: syntax=ruby
@@ -1,42 +1,46 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.0.3)
5
- exifr (1.0.3)
6
- gemcutter (0.6.1)
7
- hoe (2.8.0)
8
- rake (>= 0.8.7)
9
- i18n (0.5.0)
10
- json_pure (1.4.6)
11
- mail (2.2.13)
12
- activesupport (>= 2.3.6)
4
+ exifr (1.1.1)
5
+ gemcutter (0.7.0)
6
+ hoe (2.12.3)
7
+ rake (~> 0.8)
8
+ i18n (0.6.0)
9
+ json (1.6.1)
10
+ json_pure (1.6.1)
11
+ mail (2.3.0)
13
12
  i18n (>= 0.4.0)
14
13
  mime-types (~> 1.16)
15
14
  treetop (~> 1.4.8)
16
- mime-types (1.16)
17
- mocha (0.9.10)
18
- rake
19
- nokogiri (1.4.4)
20
- polyglot (0.3.1)
21
- rake (0.8.7)
15
+ metaclass (0.0.1)
16
+ mime-types (1.17.2)
17
+ mocha (0.10.0)
18
+ metaclass (~> 0.0.1)
19
+ nokogiri (1.5.0)
20
+ polyglot (0.3.2)
21
+ rake (0.9.2.2)
22
+ rcov (0.9.11)
23
+ rdoc (3.11)
24
+ json (~> 1.4)
22
25
  rubyforge (2.0.4)
23
26
  json_pure (>= 1.1.7)
24
27
  test-unit (1.2.3)
25
28
  hoe (>= 1.5.1)
26
- treetop (1.4.9)
29
+ treetop (1.4.10)
30
+ polyglot
27
31
  polyglot (>= 0.3.1)
28
- uuidtools (2.1.1)
29
32
 
30
33
  PLATFORMS
31
34
  ruby
32
35
 
33
36
  DEPENDENCIES
34
- exifr (>= 1.0.3)
35
- gemcutter (>= 0.4.1)
36
- hoe (>= 2.5.0)
37
- mail (>= 2.2.10)
37
+ exifr
38
+ gemcutter
39
+ hoe
40
+ mail
38
41
  mocha
39
- nokogiri (>= 1.4.4)
40
- rubyforge (>= 2.0.4)
42
+ nokogiri
43
+ rcov
44
+ rdoc
45
+ rubyforge
41
46
  test-unit (= 1.2.3)
42
- uuidtools (>= 2.1.1)
@@ -1,3 +1,10 @@
1
+ ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom)
2
+
3
+ * 2 major enhancements
4
+ * regexp's in yaml configs are store as a ruby regexp and not a string that
5
+ is evaled.
6
+ * character encoding capability with 1.8 rubies and 1.9 rubies.
7
+
1
8
  ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad)
2
9
 
3
10
  * 2 minor enhancements
@@ -1,4 +1,3 @@
1
- .gitignore
2
1
  Gemfile
3
2
  Gemfile.lock
4
3
  History.txt
@@ -43,9 +42,9 @@ conf/vzwpix.com.yml
43
42
  conf/waw.plspictures.com.yml
44
43
  dev_tools/anonymizer.rb
45
44
  dev_tools/debug_sprint_nokogiri_parsing.rb
46
- dev_tools/github.rb
47
45
  init.rb
48
- lib/mail_ext.rb
46
+ lib/ext/mail.rb
47
+ lib/ext/object.rb
49
48
  lib/mms2r.rb
50
49
  lib/mms2r/media.rb
51
50
  lib/mms2r/media/sprint.rb
@@ -55,6 +54,7 @@ test/fixtures/1nbox-2images-02.mail
55
54
  test/fixtures/1nbox-2images-03.mail
56
55
  test/fixtures/1nbox-2images-04.mail
57
56
  test/fixtures/3ireland-mms-01.mail
57
+ test/fixtures/ad_new.txt
58
58
  test/fixtures/alltel-image-01.mail
59
59
  test/fixtures/alltel-mms-01.mail
60
60
  test/fixtures/alltel-mms-03.mail
@@ -70,6 +70,7 @@ test/fixtures/att-text-01.mail
70
70
  test/fixtures/bell-canada-image-01.mail
71
71
  test/fixtures/cingularme-text-01.mail
72
72
  test/fixtures/cingularme-text-02.mail
73
+ test/fixtures/dici_un_mois_georgie.txt
73
74
  test/fixtures/dobson-image-01.mail
74
75
  test/fixtures/dot.jpg
75
76
  test/fixtures/generic.mail
@@ -140,10 +141,10 @@ test/fixtures/vodacom4me-southafrica-mms-04.mail
140
141
  test/fixtures/vtext-text-01.mail
141
142
  test/fixtures/vzwpix.com-image-01.mail
142
143
  test/fixtures/waw.plspictures.com-image-01.mail
144
+ test/hax.rb
143
145
  test/test_1nbox_net.rb
144
146
  test/test_bell_canada.rb
145
147
  test/test_bellsouth_net.rb
146
- test/test_github.rb
147
148
  test/test_helper.rb
148
149
  test/test_mediamessaging_o2_co_uk.rb
149
150
  test/test_messaging_nextel_com.rb
data/README.txt CHANGED
@@ -1,13 +1,15 @@
1
1
  = mms2r
2
2
 
3
- http://mms2r.rubyforge.org/
4
- by Mike Mondragon
5
- http://github.com/monde/mms2r
6
- http://github.com/monde/mms2r/issues
7
- http://peepcode.com/products/mms2r-pdf
3
+ https://github.com/monde/mms2r
8
4
 
9
5
  == DESCRIPTION
10
6
 
7
+ MMS2R by Mike Mondragon
8
+ http://mms2r.rubyforge.org/
9
+ https://github.com/monde/mms2r
10
+ https://github.com/monde/mms2r/issues
11
+ http://peepcode.com/products/mms2r-pdf
12
+
11
13
  MMS2R is a library that decodes the parts of an MMS message to disk while
12
14
  stripping out advertising injected by the mobile carriers. MMS messages are
13
15
  multipart email and the carriers often inject branding into these messages. Use
@@ -79,6 +81,7 @@ Corpus of smart phones known to MMS2R:
79
81
  As Seen On The Internets - sites known to be using MMS2R in some fashion
80
82
 
81
83
  * twitpic.com [http://www.twitpic.com/]
84
+ * Simplton [http://simplton.com/]
82
85
  * fanchatter.com [http://www.fanchatter.com/]
83
86
  * camura.com [http://www.camura.com/]
84
87
  * eachday.com [http://www.eachday.com/]
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  ignore:
3
3
  image/jpeg:
4
- - /^.*idea_banner.jpg$/i
4
+ - !ruby/regexp /^.*idea_banner.jpg$/i
5
5
  text/html:
6
- - /<title>Message from memova<\/title>/im
6
+ - !ruby/regexp /<title>Message from memova<\/title>/im
7
7
 
8
8
  transform:
9
9
 
10
10
  number:
11
11
  - from
12
- - /^([^\/|^@]+).*/
13
- - "\1"
12
+ - !ruby/regexp /^([^\/@]+).*/
13
+ - "\\1"
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  txt.att.net: mms.att.net
3
3
  cingularme.com: mms.att.net
4
4
  mmode.com: mms.att.net
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  ignore:
3
3
  text/plain:
4
- - /This Media Message has been sent using an O2 camera phone/mi
4
+ - !ruby/regexp /This Media Message has been sent using an O2 camera phone/mi
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  ignore:
3
- text/plain:
4
- - /^This is an MMS message. 20\d\d Sprint Nextel. All rights reserved./
5
- - /^This is an MMS message. Please go to http:\/\/mms.nextel.com\/mms\/anon\/do\/legacy\/viewDirect/
6
- - /^This is a multi-part message in MIME format./
7
- text/html:
8
- - /^<html><body>\s+<center>This is an MMS message. <br><center> 20\d\d Sprint Nextel. All rights reserved<\/center><br><img/m
9
- - /^<html><body>\s+This is an MMS message. <br><center> 20\d\d Sprint Nextel. All rights reserved/m
10
- - /^<html><body>\s+This is an MMS message. Please go to <a href="http:\/\/mms.nextel.com\/mms\/anon\/do\/legacy\/viewDirect/m
3
+ text/plain:
4
+ - !ruby/regexp /^This is an MMS message. 20\d\d Sprint Nextel. All rights reserved./
5
+ - !ruby/regexp /^This is an MMS message. Please go to http:\/\/mms.nextel.com\/mms\/anon\/do\/legacy\/viewDirect/
6
+ - !ruby/regexp /^This is a multi-part message in MIME format./
7
+ text/html:
8
+ - !ruby/regexp /^<html><body>\s+<center>This is an MMS message. <br><center> 20\d\d Sprint Nextel. All rights reserved<\/center><br><img/m
9
+ - !ruby/regexp /^<html><body>\s+This is an MMS message. <br><center> 20\d\d Sprint Nextel. All rights reserved/m
10
+ - !ruby/regexp /^<html><body>\s+This is an MMS message. Please go to <a href="http:\/\/mms.nextel.com\/mms\/anon\/do\/legacy\/viewDirect/m
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  ignore:
3
3
  image/jpeg:
4
- - /^.*tpm.jpg$/i
5
- - /^.*vf5.jpg$/i
6
- - /^.*reb.jpg$/i
4
+ - !ruby/regexp /^.*tpm.jpg$/i
5
+ - !ruby/regexp /^.*vf5.jpg$/i
6
+ - !ruby/regexp /^.*reb.jpg$/i
7
7
  image/gif:
8
- - /^.*vf9.gif$/i
8
+ - !ruby/regexp /^.*vf9.gif$/i
9
9
  text/plain:
10
- - /^You have received an MMS message. To see the message correctly, you will need to view this message.*/im
10
+ - !ruby/regexp /^You have received an MMS message. To see the message correctly, you will need to view this message.*/im
11
11
  text/html:
12
- - /Yospace Technologies Ltd - MMS-to-Email version 1-0-1-1/im
12
+ - !ruby/regexp /Yospace Technologies Ltd - MMS-to-Email version 1-0-1-1/im
13
13
 
14
14
  number:
15
15
  - from
16
- - /^([^\s|^\/|^@]+).*/
17
- - "\1"
16
+ - !ruby/regexp /^([^\s\/@]+).*/
17
+ - "\\1"
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  ignore:
3
3
  application/smil:
4
- - /^pres\.smil/i
4
+ - !ruby/regexp /^pres\.smil/i
5
5
 
@@ -4,8 +4,8 @@ ignore:
4
4
  - mms
5
5
  text/html:
6
6
  - mms.smil.txt
7
- - /<html>\s+<head>\s+<title>Picture Messaging<\/title>/m
8
- image/gif:
7
+ - !ruby/regexp /<html>\s+<head>\s+<title>Picture Messaging<\/title>/m
8
+ image/gif:
9
9
  - spacer.gif
10
10
  - header.gif
11
11
  - bluebar.gif
@@ -1,11 +1,11 @@
1
1
  ---
2
- transform:
3
- text/plain:
4
- - - /^Multimedia message$/i
2
+ transform:
3
+ text/plain:
4
+ - - !ruby/regexp /^Multimedia message$/i
5
5
  - ""
6
- - - /\A(.+?)\s+--\s+=+\s+This mobile text message is brought to you by AT&T.*/im
7
- - "\1"
8
- - - /\A(.+?)\s+--\s+=+\s+Brought to you by, Cingular Wireless Messaging.*/im
9
- - "\1"
10
- - - /\A(.+?)\s+--\s+Mobile Email from a Cingular Wireless Customer.*/im
11
- - "\1"
6
+ - - !ruby/regexp /\A(.+?)\s+--\s+=+\s+This mobile text message is brought to you by AT&T.*/im
7
+ - "\\1"
8
+ - - !ruby/regexp /\A(.+?)\s+--\s+=+\s+Brought to you by, Cingular Wireless Messaging.*/im
9
+ - "\\1"
10
+ - - !ruby/regexp /\A(.+?)\s+--\s+Mobile Email from a Cingular Wireless Customer.*/im
11
+ - "\\1"
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  ignore:
3
- application/smil:
4
- - /^<smil><head><layout><root-layout width=/i
3
+ application/smil:
4
+ - !ruby/regexp /^<smil><head><layout><root-layout width=/i
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  ignore:
3
- image/gif:
4
- - /^Vodafone Logo/i
5
- text/html:
6
- - /You have received a picture message from phone number/im
7
- text/plain:
8
- - /You have received a picture message from mobile phone number/im
3
+ image/gif:
4
+ - !ruby/regexp /^Vodafone Logo/i
5
+ text/html:
6
+ - !ruby/regexp /You have received a picture message from phone number/im
7
+ text/plain:
8
+ - !ruby/regexp /You have received a picture message from mobile phone number/im
9
9
  number:
10
10
  - from
11
- - /^([^\s]+)\s.*/
12
- - "\1"
11
+ - !ruby/regexp /^([^\s]+)\s.*/
12
+ - "\\1"
13
13
 
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  ignore:
3
3
  image/jpeg:
4
- - /^.*html_DEFAULT_SLIDE_header.JPG$/i
4
+ - !ruby/regexp /^.*html_DEFAULT_SLIDE_header.JPG$/i
5
5
  image/gif:
6
- - /^.*footer.gif$/i
7
- - /^.*reply.gif$/i
6
+ - !ruby/regexp /^.*footer.gif$/i
7
+ - !ruby/regexp /^.*reply.gif$/i
8
8
  text/html:
9
- - /.*/
9
+ - !ruby/regexp /.*/
10
10
 
11
11
  transform:
12
12
 
13
13
  number:
14
14
  - from
15
- - /^([^\/|^@]+).*/
16
- - "\1"
15
+ - !ruby/regexp /^([^\/@]+).*/
16
+ - "\\1"
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  ignore:
3
3
  image/bmp:
4
- - /^.*logo.bmp$/i
4
+ - !ruby/regexp /^.*logo.bmp$/i
5
5
  text/html:
6
- - /.*/
6
+ - !ruby/regexp /.*/
7
7
 
8
8
  transform:
9
9
 
10
10
  number:
11
11
  - from
12
- - /^([^\/|^@]+).*/
13
- - "\1"
12
+ - !ruby/regexp /^([^\/@]+).*/
13
+ - "\\1"
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  ignore:
3
- image/gif:
3
+ image/gif:
4
4
  - top.gif
5
5
  - bottom.gif
6
6
  - middle_img.gif
7
- text/html:
8
- - /<html>\s+<head>\s+<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\">\s+<title>MMS Email<\/title>/im
9
- transform:
10
- text/plain:
11
- - - /Note:\s{1,2}.*?\s+message:\s{1,2}(.+)$/m
12
- - "\1"
7
+ text/html:
8
+ - !ruby/regexp /<html>\s+<head>\s+<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\">\s+<title>MMS Email<\/title>/im
9
+ transform:
10
+ text/plain:
11
+ - - !ruby/regexp /Note:\s{1,2}.*?\s+message:\s{1,2}(.+)$/m
12
+ - "\\1"
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  ignore:
3
- text/plain:
4
- - /Meldingen er sendt fra mobiltelefon og kan kun besvares med mobiltelefon. Nummeret finner du i e-postadressen./im
3
+ text/plain:
4
+ - !ruby/regexp /Meldingen er sendt fra mobiltelefon og kan kun besvares med mobiltelefon. Nummeret finner du i e-postadressen./im
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  ignore:
3
- text/html:
4
- - /Diese Nachricht wurde Ihnen von einem Handy mit der Nummer/im
5
- transform:
6
- text/plain:
7
- - - /.*bermittelt.\s+(.+)\s+Wenn Sie mehr.*/im
8
- - "\1"
3
+ text/html:
4
+ - !ruby/regexp /Diese Nachricht wurde Ihnen von einem Handy mit der Nummer/im
5
+ transform:
6
+ text/plain:
7
+ - - !ruby/regexp /.*bermittelt.\s+(.+)\s+Wenn Sie mehr.*/im
8
+ - "\\1"
@@ -1,15 +1,15 @@
1
1
  ---
2
- transform:
3
- text/plain:
4
- - - /^You have received a new message$/i
2
+ transform:
3
+ text/plain:
4
+ - - !ruby/regexp /^You have received a new message$/i
5
5
  - ""
6
6
  ignore:
7
- image/jpeg:
7
+ image/jpeg:
8
8
  - images/reb.jpg
9
9
  - images/tpm.jpg
10
- image/gif:
10
+ image/gif:
11
11
  - images/vf9.gif
12
- text/html:
13
- - /<html><head>.*<title>MMS Message<\/title>/im
14
- text/plain:
15
- - /You have received an MMS message. To see the message correctly, you will need to view this message\s+in a graphical email application./im
12
+ text/html:
13
+ - !ruby/regexp /<html><head>.*<title>MMS Message<\/title>/im
14
+ text/plain:
15
+ - !ruby/regexp /You have received an MMS message. To see the message correctly, you will need to view this message\s+in a graphical email application./im