mms2r 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/README.TMail.txt +32 -0
- data/README.txt +6 -2
- data/Rakefile +13 -2
- data/lib/mms2r.rb +10 -11
- data/lib/mms2r/media.rb +6 -2
- data/lib/mms2r/media/sprint.rb +0 -1
- data/mms2r.gemspec +1 -1
- data/test/test_helper.rb +22 -9
- data/test/test_pm_sprint_com.rb +0 -1
- metadata +5 -5
data/History.txt
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
+
### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist)
|
2
|
+
|
3
|
+
* 3 minor enhancements
|
4
|
+
* updated readme with latest sites known to use mms2r
|
5
|
+
* bundler assimilated
|
6
|
+
* loading rubygems only if it's required, like rake
|
7
|
+
|
1
8
|
### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer)
|
9
|
+
|
2
10
|
* 8 minor enhancements
|
3
11
|
* Detects additional Bell/AT&T domain sbcglobal.net as a handset
|
4
12
|
* Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset
|
data/README.TMail.txt
CHANGED
@@ -9,3 +9,35 @@ publish point releases for 2.4.X. But I may not so don't count on it. Version
|
|
9
9
|
the Mail gem.
|
10
10
|
Thank you
|
11
11
|
Mike
|
12
|
+
|
13
|
+
7/24/2010
|
14
|
+
If you want to use Mail instead of TMail in an Rails 2.3 or lower ActionMailer
|
15
|
+
this is one way to do it:
|
16
|
+
|
17
|
+
http://gist.github.com/486883
|
18
|
+
|
19
|
+
|
20
|
+
class MailReceiver < ActionMailer::Base
|
21
|
+
|
22
|
+
# patch ActionMailer::Base to put a ActionMailer::Base#raw_email
|
23
|
+
# accessor on the created instance
|
24
|
+
class << self
|
25
|
+
alias :old_receive :receive
|
26
|
+
def receive(raw_email)
|
27
|
+
send(:define_method, :raw_email) { raw_email }
|
28
|
+
self.old_receive(raw_email)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# Injest email/MMS here
|
34
|
+
|
35
|
+
def receive(tmail)
|
36
|
+
# completely ignore the tmail object rails passes in Rails 2.*
|
37
|
+
|
38
|
+
mail = Mail.new(self.raw_email)
|
39
|
+
mms = MMS2R::Media.new(mail, :logger => Rails.logger)
|
40
|
+
|
41
|
+
# do something
|
42
|
+
end
|
43
|
+
end
|
data/README.txt
CHANGED
@@ -107,8 +107,12 @@ http://peepcode.com/products/mms2r-pdf
|
|
107
107
|
|
108
108
|
== SYNOPSIS
|
109
109
|
|
110
|
-
|
111
|
-
|
110
|
+
begin
|
111
|
+
require 'mms2r'
|
112
|
+
rescue LoadError
|
113
|
+
require 'rubygems'
|
114
|
+
require 'mms2r'
|
115
|
+
end
|
112
116
|
|
113
117
|
# required for the example
|
114
118
|
require 'fileutils'
|
data/Rakefile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
|
-
|
4
|
-
require 'hoe'
|
3
|
+
begin
|
4
|
+
require 'hoe'
|
5
|
+
rescue LoadError
|
6
|
+
require 'rubygems'
|
7
|
+
require 'hoe'
|
8
|
+
end
|
5
9
|
|
6
10
|
begin
|
7
11
|
require 'rcov/rcovtask'
|
@@ -11,6 +15,7 @@ end
|
|
11
15
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib")
|
12
16
|
require 'mms2r'
|
13
17
|
|
18
|
+
Hoe.plugin :bundler
|
14
19
|
Hoe.spec('mms2r') do |p|
|
15
20
|
p.version = MMS2R::Media::VERSION
|
16
21
|
p.rubyforge_name = 'mms2r'
|
@@ -38,5 +43,11 @@ rescue
|
|
38
43
|
task :rcov => :check_dependencies
|
39
44
|
end
|
40
45
|
|
46
|
+
RDoc::Task.new do |rdoc|
|
47
|
+
rdoc.title = "mms2r-#{MMS2R::Media::VERSION}"
|
48
|
+
rdoc.rdoc_dir = 'doc'
|
49
|
+
rdoc.options << '-f' << 'horo'
|
50
|
+
rdoc.options << '--main' << 'README.txt'
|
51
|
+
end
|
41
52
|
|
42
53
|
# vim: syntax=Ruby
|
data/lib/mms2r.rb
CHANGED
@@ -39,7 +39,7 @@ module MMS2R
|
|
39
39
|
##
|
40
40
|
# MMS2R library version
|
41
41
|
|
42
|
-
VERSION = '3.
|
42
|
+
VERSION = '3.2.0'
|
43
43
|
|
44
44
|
end
|
45
45
|
|
@@ -53,16 +53,15 @@ module MMS2R
|
|
53
53
|
|
54
54
|
end
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
require
|
60
|
-
|
61
|
-
require '
|
62
|
-
require
|
63
|
-
|
64
|
-
|
65
|
-
require 'exifr'
|
56
|
+
%W{ mail fileutils pathname tmpdir yaml uuidtools iconv exifr }.each do |g|
|
57
|
+
begin
|
58
|
+
gem 'mail', '= 2.2.5' if g == 'mail'
|
59
|
+
require g
|
60
|
+
rescue LoadError
|
61
|
+
require 'rubygems'
|
62
|
+
require g
|
63
|
+
end
|
64
|
+
end
|
66
65
|
|
67
66
|
require File.join(File.dirname(__FILE__), 'mail_ext')
|
68
67
|
require File.join(File.dirname(__FILE__), 'mms2r', 'media')
|
data/lib/mms2r/media.rb
CHANGED
@@ -21,8 +21,12 @@
|
|
21
21
|
#
|
22
22
|
# == Stand Alone Example
|
23
23
|
#
|
24
|
-
#
|
25
|
-
#
|
24
|
+
# begin
|
25
|
+
# require 'mms2r'
|
26
|
+
# rescue LoadError
|
27
|
+
# require 'rubygems'
|
28
|
+
# require 'mms2r'
|
29
|
+
# end
|
26
30
|
# mail = Mail.read("sample-MMS.file")
|
27
31
|
# mms = MMS2R::Media.new(mail)
|
28
32
|
# subject = mms.subject
|
data/lib/mms2r/media/sprint.rb
CHANGED
data/mms2r.gemspec
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,15 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require '
|
5
|
-
|
6
|
-
require '
|
7
|
-
|
8
|
-
require '
|
9
|
-
|
1
|
+
# do it like rake http://ozmm.org/posts/do_it_like_rake.html
|
2
|
+
begin
|
3
|
+
gem 'test-unit', '= 1.2.3'
|
4
|
+
require 'test/unit'
|
5
|
+
rescue NoMethodError
|
6
|
+
require 'rubygems'
|
7
|
+
gem 'test-unit', '= 1.2.3'
|
8
|
+
require 'test/unit'
|
9
|
+
end
|
10
10
|
|
11
|
+
%W{ set net/http net/https pp tempfile mocha }.each do |g|
|
12
|
+
begin
|
13
|
+
require g
|
14
|
+
rescue LoadError
|
15
|
+
require 'rubygems'
|
16
|
+
require g
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# NOTE when we upgrade to test-unit 2.x.x or greater we'll not need redgreen,
|
21
|
+
# it's baked into test-unit
|
11
22
|
begin require 'redgreen'; rescue LoadError; end
|
12
23
|
|
24
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r')
|
25
|
+
|
13
26
|
module MMS2R
|
14
27
|
module TestHelper
|
15
28
|
|
data/test/test_pm_sprint_com.rb
CHANGED
@@ -191,7 +191,6 @@ class TestPmSprintCom < Test::Unit::TestCase
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def test_sprint_write_file
|
194
|
-
require 'tempfile'
|
195
194
|
mail = mock(:message_id => 'a')
|
196
195
|
mail.expects(:from).at_least_once.returns(['joe@pm.sprint.com'])
|
197
196
|
mail.expects(:return_path).at_least_once.returns('joe@pm.sprint.com')
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 3
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 3.
|
9
|
+
version: 3.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mike Mondragon
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-08-17 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -83,8 +83,8 @@ dependencies:
|
|
83
83
|
segments:
|
84
84
|
- 2
|
85
85
|
- 0
|
86
|
-
-
|
87
|
-
version: 2.0.
|
86
|
+
- 4
|
87
|
+
version: 2.0.4
|
88
88
|
type: :development
|
89
89
|
version_requirements: *id005
|
90
90
|
- !ruby/object:Gem::Dependency
|