postmark-mitt 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/postmark/mitt.rb +14 -1
- data/postmark-mitt.gemspec +3 -3
- data/spec/fixtures/email.json +7 -1
- data/spec/postmark/mitt_spec.rb +10 -1
- metadata +81 -88
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/lib/postmark/mitt.rb
CHANGED
@@ -28,8 +28,21 @@ module Postmark
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def to
|
31
|
-
source["To"]
|
31
|
+
source["To"].gsub('"', '')
|
32
32
|
end
|
33
|
+
|
34
|
+
def to_full
|
35
|
+
source["ToFull"] || []
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_email
|
39
|
+
to_full.any? ? to_full.first["Email"] : to
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_name
|
43
|
+
to_full.any? ? to_full.first["Name"] : to
|
44
|
+
end
|
45
|
+
|
33
46
|
|
34
47
|
def bcc
|
35
48
|
source["Bcc"]
|
data/postmark-mitt.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "postmark-mitt"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Randy Schmidt"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-06-25"
|
13
13
|
s.description = "This gem will help you take JSON posted to your app from incoming email through Postmark. It will turn it back into an object with methods to help inspect the contents of the email"
|
14
14
|
s.email = "randy@forge38.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.homepage = "http://github.com/r38y/postmark-mitt"
|
34
34
|
s.licenses = ["MIT"]
|
35
35
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = "1.8.
|
36
|
+
s.rubygems_version = "1.8.23"
|
37
37
|
s.summary = "Mitt for incoming email through Postmark"
|
38
38
|
|
39
39
|
if s.respond_to? :specification_version then
|
data/spec/fixtures/email.json
CHANGED
@@ -69,5 +69,11 @@
|
|
69
69
|
"Subject": "Hi There",
|
70
70
|
"Tag": "yourit",
|
71
71
|
"TextBody": "\nThis is awesome!\n\n",
|
72
|
-
"To": "api-hash@inbound.postmarkapp.com"
|
72
|
+
"To": "\"Api Hash\" <api-hash@inbound.postmarkapp.com>",
|
73
|
+
"ToFull": [
|
74
|
+
{
|
75
|
+
"Email": "api-hash@inbound.postmarkapp.com",
|
76
|
+
"Name": "Api Hash"
|
77
|
+
}
|
78
|
+
]
|
73
79
|
}
|
data/spec/postmark/mitt_spec.rb
CHANGED
@@ -18,8 +18,17 @@ describe Postmark::Mitt do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should be to someone" do
|
21
|
-
mitt.to.should == "api-hash@inbound.postmarkapp.com"
|
21
|
+
mitt.to.should == "Api Hash <api-hash@inbound.postmarkapp.com>"
|
22
22
|
end
|
23
|
+
|
24
|
+
it "should pull out the to_name" do
|
25
|
+
mitt.to_name.should == "Api Hash"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should pull out the to_email" do
|
29
|
+
mitt.to_email.should == "api-hash@inbound.postmarkapp.com"
|
30
|
+
end
|
31
|
+
|
23
32
|
|
24
33
|
it "should be from someone" do
|
25
34
|
mitt.from.should == "Bob Bobson <bob@bob.com>"
|
metadata
CHANGED
@@ -1,107 +1,106 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark-mitt
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 10
|
10
|
-
version: 0.0.10
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Randy Schmidt
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: json_pure
|
22
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :runtime
|
32
23
|
prerelease: false
|
33
|
-
|
34
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
35
31
|
name: multi_json
|
36
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
37
33
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
version: "0"
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
45
38
|
type: :runtime
|
46
39
|
prerelease: false
|
47
|
-
|
48
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
49
47
|
name: rspec
|
50
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
51
49
|
none: false
|
52
|
-
requirements:
|
50
|
+
requirements:
|
53
51
|
- - ~>
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
hash: 43
|
56
|
-
segments:
|
57
|
-
- 2
|
58
|
-
- 9
|
59
|
-
- 0
|
52
|
+
- !ruby/object:Gem::Version
|
60
53
|
version: 2.9.0
|
61
54
|
type: :development
|
62
55
|
prerelease: false
|
63
|
-
|
64
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.9.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
65
63
|
name: bundler
|
66
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
67
65
|
none: false
|
68
|
-
requirements:
|
66
|
+
requirements:
|
69
67
|
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
segments:
|
73
|
-
- 1
|
74
|
-
- 0
|
75
|
-
version: "1.0"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.0'
|
76
70
|
type: :development
|
77
71
|
prerelease: false
|
78
|
-
|
79
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
80
79
|
name: jeweler
|
81
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
82
81
|
none: false
|
83
|
-
requirements:
|
82
|
+
requirements:
|
84
83
|
- - ~>
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
hash: 49
|
87
|
-
segments:
|
88
|
-
- 1
|
89
|
-
- 8
|
90
|
-
- 3
|
84
|
+
- !ruby/object:Gem::Version
|
91
85
|
version: 1.8.3
|
92
86
|
type: :development
|
93
87
|
prerelease: false
|
94
|
-
|
95
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.8.3
|
94
|
+
description: This gem will help you take JSON posted to your app from incoming email
|
95
|
+
through Postmark. It will turn it back into an object with methods to help inspect
|
96
|
+
the contents of the email
|
96
97
|
email: randy@forge38.com
|
97
98
|
executables: []
|
98
|
-
|
99
99
|
extensions: []
|
100
|
-
|
101
|
-
extra_rdoc_files:
|
100
|
+
extra_rdoc_files:
|
102
101
|
- LICENSE
|
103
102
|
- README.rdoc
|
104
|
-
files:
|
103
|
+
files:
|
105
104
|
- Gemfile
|
106
105
|
- LICENSE
|
107
106
|
- README.rdoc
|
@@ -115,37 +114,31 @@ files:
|
|
115
114
|
- spec/postmark/mitt_spec.rb
|
116
115
|
- spec/spec_helper.rb
|
117
116
|
homepage: http://github.com/r38y/postmark-mitt
|
118
|
-
licenses:
|
117
|
+
licenses:
|
119
118
|
- MIT
|
120
119
|
post_install_message:
|
121
120
|
rdoc_options: []
|
122
|
-
|
123
|
-
require_paths:
|
121
|
+
require_paths:
|
124
122
|
- lib
|
125
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
124
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
segments:
|
125
|
+
requirements:
|
126
|
+
- - ! '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
segments:
|
132
130
|
- 0
|
133
|
-
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
hash: 144173986156973085
|
132
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
133
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
segments:
|
141
|
-
- 0
|
142
|
-
version: "0"
|
134
|
+
requirements:
|
135
|
+
- - ! '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
143
138
|
requirements: []
|
144
|
-
|
145
139
|
rubyforge_project:
|
146
|
-
rubygems_version: 1.8.
|
140
|
+
rubygems_version: 1.8.23
|
147
141
|
signing_key:
|
148
142
|
specification_version: 3
|
149
143
|
summary: Mitt for incoming email through Postmark
|
150
144
|
test_files: []
|
151
|
-
|