postageapp 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.10
1
+ 1.0.11
@@ -83,7 +83,7 @@ class PostageApp::Request
83
83
  if !PostageApp.configuration.recipient_override.nil? && self.method.to_sym == :send_message
84
84
  self.arguments.merge!('recipient_override' => PostageApp.configuration.recipient_override)
85
85
  end
86
- hash.merge!('arguments' => self.arguments.stringify_keys!)
86
+ hash.merge!('arguments' => self.arguments.recursive_stringify_keys!)
87
87
  end
88
88
  hash
89
89
  end
@@ -11,9 +11,10 @@ class Hash
11
11
  end
12
12
 
13
13
  # Destructively convert all keys to strings.
14
- def stringify_keys!
14
+ def recursive_stringify_keys!
15
15
  keys.each do |key|
16
- self[key.to_s] = delete(key)
16
+ value = delete(key)
17
+ self[key.to_s] = value.is_a?(Hash) ? value.recursive_stringify_keys! : value
17
18
  end
18
19
  self
19
20
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postageapp}
8
- s.version = "1.0.10"
8
+ s.version = "1.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 = ["Oleg Khabarov, The Working Group Inc"]
12
- s.date = %q{2011-01-06}
12
+ s.date = %q{2011-06-22}
13
13
  s.description = %q{Gem that interfaces with PostageApp.com service to send emails from web apps}
14
14
  s.email = %q{oleg@twg.ca}
15
15
  s.extra_rdoc_files = [
@@ -72,26 +72,10 @@ Gem::Specification.new do |s|
72
72
  ]
73
73
  s.homepage = %q{http://github.com/postageapp/postageapp-ruby}
74
74
  s.require_paths = ["lib"]
75
- s.rubygems_version = %q{1.3.7}
75
+ s.rubygems_version = %q{1.7.2}
76
76
  s.summary = %q{Easier way to send email from web apps}
77
- s.test_files = [
78
- "test/configuration_test.rb",
79
- "test/failed_request_test.rb",
80
- "test/helper.rb",
81
- "test/live_test.rb",
82
- "test/mailer/action_mailer_2/notifier.rb",
83
- "test/mailer/action_mailer_3/notifier.rb",
84
- "test/mailer_2_test.rb",
85
- "test/mailer_3_test.rb",
86
- "test/mailer_helper_methods_test.rb",
87
- "test/postageapp_test.rb",
88
- "test/rails_initialization_test.rb",
89
- "test/request_test.rb",
90
- "test/response_test.rb"
91
- ]
92
77
 
93
78
  if s.respond_to? :specification_version then
94
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
95
79
  s.specification_version = 3
96
80
 
97
81
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -18,11 +18,26 @@ class RequestTest < Test::Unit::TestCase
18
18
  end
19
19
 
20
20
  def test_method_arguments_to_send
21
- request = PostageApp::Request.new(:test_method)
21
+ request = PostageApp::Request.new(:send_message, {
22
+ :headers => { :from => 'sender@test.test',
23
+ 'subject' => 'Test Message' },
24
+ 'recipients' => 'test@test.test',
25
+ :content => {
26
+ 'text/plain' => 'text content',
27
+ :"text/html" => 'html content'
28
+ }
29
+ })
22
30
  args = request.arguments_to_send
23
31
  assert_equal '1234567890abcdef', args['api_key']
24
32
  assert_match /^\w{40}$/, args['uid']
25
33
 
34
+ payload = args['arguments']
35
+ assert_equal 'sender@test.test', payload['headers']['from']
36
+ assert_equal 'Test Message', payload['headers']['subject']
37
+ assert_equal 'test@test.test', payload['recipients']
38
+ assert_equal 'text content', payload['content']['text/plain']
39
+ assert_equal 'html content', payload['content']['text/html']
40
+
26
41
  request.arguments = { 'data' => 'content' }
27
42
  args = request.arguments_to_send
28
43
  assert_equal '1234567890abcdef', args['api_key']
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postageapp
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 10
9
- version: 1.0.10
4
+ prerelease:
5
+ version: 1.0.11
10
6
  platform: ruby
11
7
  authors:
12
8
  - Oleg Khabarov, The Working Group Inc
@@ -14,8 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-01-06 00:00:00 -05:00
18
- default_executable:
13
+ date: 2011-06-22 00:00:00 Z
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
16
  name: json
@@ -25,10 +20,6 @@ dependencies:
25
20
  requirements:
26
21
  - - ">="
27
22
  - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 4
31
- - 6
32
23
  version: 1.4.6
33
24
  type: :runtime
34
25
  version_requirements: *id001
@@ -40,10 +31,6 @@ dependencies:
40
31
  requirements:
41
32
  - - ">="
42
33
  - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 9
46
- - 8
47
34
  version: 0.9.8
48
35
  type: :development
49
36
  version_requirements: *id002
@@ -109,7 +96,6 @@ files:
109
96
  - test/rails_initialization_test.rb
110
97
  - test/request_test.rb
111
98
  - test/response_test.rb
112
- has_rdoc: true
113
99
  homepage: http://github.com/postageapp/postageapp-ruby
114
100
  licenses: []
115
101
 
@@ -123,35 +109,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
109
  requirements:
124
110
  - - ">="
125
111
  - !ruby/object:Gem::Version
126
- segments:
127
- - 0
128
112
  version: "0"
129
113
  required_rubygems_version: !ruby/object:Gem::Requirement
130
114
  none: false
131
115
  requirements:
132
116
  - - ">="
133
117
  - !ruby/object:Gem::Version
134
- segments:
135
- - 0
136
118
  version: "0"
137
119
  requirements: []
138
120
 
139
121
  rubyforge_project:
140
- rubygems_version: 1.3.7
122
+ rubygems_version: 1.7.2
141
123
  signing_key:
142
124
  specification_version: 3
143
125
  summary: Easier way to send email from web apps
144
- test_files:
145
- - test/configuration_test.rb
146
- - test/failed_request_test.rb
147
- - test/helper.rb
148
- - test/live_test.rb
149
- - test/mailer/action_mailer_2/notifier.rb
150
- - test/mailer/action_mailer_3/notifier.rb
151
- - test/mailer_2_test.rb
152
- - test/mailer_3_test.rb
153
- - test/mailer_helper_methods_test.rb
154
- - test/postageapp_test.rb
155
- - test/rails_initialization_test.rb
156
- - test/request_test.rb
157
- - test/response_test.rb
126
+ test_files: []
127
+