postmark 0.9.5 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = Changelog
2
2
 
3
+ == 0.9.6
4
+
5
+ * Fixed exception when content-type wasn't explicitly specified.
6
+ * Removed tmail from the list of dependencies.
7
+
3
8
  == 0.9.5
4
9
 
5
10
  * Fixed a problem of HTML content detection when using Mail gem.
data/README.rdoc CHANGED
@@ -1,14 +1,18 @@
1
- = Postmark gem
1
+ = Postmark Gem
2
2
 
3
- Ruby gem for sending emails through http://postmarkapp.com HTTP API
3
+ This gem is an official wrapper for Postmark HTTP API (http://postmarkapp.com). Use it to send emails and retrieve info about bounces.
4
4
 
5
5
  == Install
6
6
 
7
- sudo gem install postmark
7
+ gem install postmark
8
+
9
+ In addition to the +postmark+ gem you also need to install +tmail+ or +mail+ gem. Pick the one you like most:
8
10
 
9
- == Example
11
+ gem install mail
12
+ - or -
13
+ gem install tmail
10
14
 
11
- #!/usr/bin/env ruby
15
+ == TMail Example
12
16
 
13
17
  require 'rubygems'
14
18
  require 'postmark'
@@ -39,13 +43,22 @@ Ruby gem for sending emails through http://postmarkapp.com HTTP API
39
43
  message.reply_to = "penny@bigbangtheory.com"
40
44
 
41
45
  Postmark.send_through_postmark(message)
46
+
47
+ == Mail Example
42
48
 
43
- If you are using the Mail gem, you can also use Postmark as a delivery method like:
44
-
49
+ require 'rubygems'
50
+ require 'postmark'
51
+ require 'mail'
52
+
45
53
  message = Mail.new
46
- message.delivery_method Mail::Postmark, {:api_key => "your-api-key"}
54
+ message.delivery_method(Mail::Postmark, :api_key => "your-api-key")
55
+ # ...
56
+ # same as in example above
57
+ # ...
47
58
  message.deliver
48
59
 
60
+ == Other API Features
61
+
49
62
  You can retrieve various information about your server state using the Public bounces API - http://developer.postmarkapp.com/bounces
50
63
 
51
64
  # Get delivery stats: (JSON format)
@@ -95,4 +108,4 @@ You can also explicitly specify which one to be used, using
95
108
 
96
109
  == Copyright
97
110
 
98
- Copyright (c) 2010 Wildbit LLC. See LICENSE for details.
111
+ Copyright (c) 2011 Wildbit LLC. See LICENSE for details.
data/Rakefile CHANGED
@@ -4,23 +4,28 @@ require 'rake'
4
4
  begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
- gem.name = "postmark"
8
- gem.summary = %Q{Ruby gem for sending emails through http://postmarkapp.com HTTP API}
9
- gem.description = %Q{Ruby gem for sending emails through http://postmarkapp.com HTTP API. It relieas on TMail::Mail for message construction.}
10
- gem.email = "underlog@gmail.com"
11
- gem.homepage = "http://postmarkapp.com"
12
- gem.authors = ["Petyo Ivanov", "Ilya Sabanin"]
7
+ gem.name = "postmark"
8
+ gem.summary = %Q{Official Postmark API wrapper.}
9
+ gem.description = %Q{Use this gem to send emails through Postmark HTTP API and retrieve info about bounces.}
10
+ gem.email = "ilya@wildbit.com"
11
+ gem.homepage = "http://postmarkapp.com"
12
+ gem.authors = ["Petyo Ivanov", "Ilya Sabanin"]
13
+
13
14
  gem.add_development_dependency "rspec"
14
- gem.add_development_dependency "cucumber"
15
- gem.add_dependency "tmail"
16
- gem.files << "lib/postmark/tmail_mail_extension.rb"
15
+ gem.add_development_dependency "activesupport"
16
+ gem.add_development_dependency "json"
17
+ gem.add_development_dependency "ruby-debug"
18
+ gem.add_development_dependency "fakeweb"
19
+ gem.add_development_dependency "fakeweb-matcher"
20
+ gem.add_development_dependency "timecop"
21
+ gem.add_development_dependency "yajl-ruby"
22
+
17
23
  gem.post_install_message = %q[
18
24
  ==================
19
25
  Thanks for installing the postmark gem. If you don't have an account, please sign up at http://postmarkapp.com/.
20
26
  Review the README.rdoc for implementation details and examples.
21
27
  ==================
22
28
  ]
23
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
24
29
  end
25
30
  Jeweler::GemcutterTasks.new
26
31
  rescue LoadError
@@ -41,17 +46,6 @@ end
41
46
 
42
47
  task :spec => :check_dependencies
43
48
 
44
- begin
45
- require 'cucumber/rake/task'
46
- Cucumber::Rake::Task.new(:features)
47
-
48
- task :features => :check_dependencies
49
- rescue LoadError
50
- task :features do
51
- abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
52
- end
53
- end
54
-
55
49
  task :default => :spec
56
50
 
57
51
  require 'rake/rdoctask'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5
1
+ 0.9.6
@@ -4,7 +4,7 @@ module Mail
4
4
  include Postmark::SharedMessageExtensions
5
5
 
6
6
  def html?
7
- content_type.include?('text/html')
7
+ content_type && content_type.include?('text/html')
8
8
  end
9
9
 
10
10
  def body_html
data/postmark.gemspec CHANGED
@@ -1,54 +1,48 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postmark}
8
- s.version = "0.9.5"
8
+ s.version = "0.9.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Petyo Ivanov", "Ilya Sabanin"]
12
- s.date = %q{2010-11-17}
13
- s.description = %q{Ruby gem for sending emails through http://postmarkapp.com HTTP API. It relieas on TMail::Mail for message construction.}
14
- s.email = %q{underlog@gmail.com}
12
+ s.date = %q{2011-02-23}
13
+ s.description = %q{Use this gem to send emails through Postmark HTTP API and retrieve info about bounces.}
14
+ s.email = %q{ilya@wildbit.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".bundle/config",
21
- ".document",
22
- ".gitignore",
23
- ".rake_tasks",
24
- "CHANGELOG.rdoc",
25
- "Gemfile",
26
- "Gemfile.lock",
27
- "LICENSE",
28
- "README.rdoc",
29
- "Rakefile",
30
- "VERSION",
31
- "features/postmark.feature",
32
- "features/step_definitions/postmark_steps.rb",
33
- "features/support/env.rb",
34
- "init.rb",
35
- "lib/postmark.rb",
36
- "lib/postmark/attachments_fix_for_mail.rb",
37
- "lib/postmark/bounce.rb",
38
- "lib/postmark/handlers/mail.rb",
39
- "lib/postmark/http_client.rb",
40
- "lib/postmark/json.rb",
41
- "lib/postmark/message_extensions/mail.rb",
42
- "lib/postmark/message_extensions/shared.rb",
43
- "lib/postmark/message_extensions/tmail.rb",
44
- "lib/postmark/response_parsers/active_support.rb",
45
- "lib/postmark/response_parsers/json.rb",
46
- "lib/postmark/response_parsers/yajl.rb",
47
- "postmark.gemspec",
48
- "spec/bounce_spec.rb",
49
- "spec/postmark_spec.rb",
50
- "spec/spec.opts",
51
- "spec/spec_helper.rb"
21
+ ".document",
22
+ ".rake_tasks",
23
+ "CHANGELOG.rdoc",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "init.rb",
29
+ "lib/postmark.rb",
30
+ "lib/postmark/attachments_fix_for_mail.rb",
31
+ "lib/postmark/bounce.rb",
32
+ "lib/postmark/handlers/mail.rb",
33
+ "lib/postmark/http_client.rb",
34
+ "lib/postmark/json.rb",
35
+ "lib/postmark/message_extensions/mail.rb",
36
+ "lib/postmark/message_extensions/shared.rb",
37
+ "lib/postmark/message_extensions/tmail.rb",
38
+ "lib/postmark/response_parsers/active_support.rb",
39
+ "lib/postmark/response_parsers/json.rb",
40
+ "lib/postmark/response_parsers/yajl.rb",
41
+ "postmark.gemspec",
42
+ "spec/bounce_spec.rb",
43
+ "spec/postmark_spec.rb",
44
+ "spec/spec.opts",
45
+ "spec/spec_helper.rb"
52
46
  ]
53
47
  s.homepage = %q{http://postmarkapp.com}
54
48
  s.post_install_message = %q{
@@ -57,14 +51,13 @@ Gem::Specification.new do |s|
57
51
  Review the README.rdoc for implementation details and examples.
58
52
  ==================
59
53
  }
60
- s.rdoc_options = ["--charset=UTF-8"]
61
54
  s.require_paths = ["lib"]
62
55
  s.rubygems_version = %q{1.3.7}
63
- s.summary = %q{Ruby gem for sending emails through http://postmarkapp.com HTTP API}
56
+ s.summary = %q{Official Postmark API wrapper.}
64
57
  s.test_files = [
65
58
  "spec/bounce_spec.rb",
66
- "spec/postmark_spec.rb",
67
- "spec/spec_helper.rb"
59
+ "spec/postmark_spec.rb",
60
+ "spec/spec_helper.rb"
68
61
  ]
69
62
 
70
63
  if s.respond_to? :specification_version then
@@ -73,17 +66,32 @@ Gem::Specification.new do |s|
73
66
 
74
67
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
75
68
  s.add_development_dependency(%q<rspec>, [">= 0"])
76
- s.add_development_dependency(%q<cucumber>, [">= 0"])
77
- s.add_runtime_dependency(%q<tmail>, [">= 0"])
69
+ s.add_development_dependency(%q<activesupport>, [">= 0"])
70
+ s.add_development_dependency(%q<json>, [">= 0"])
71
+ s.add_development_dependency(%q<ruby-debug>, [">= 0"])
72
+ s.add_development_dependency(%q<fakeweb>, [">= 0"])
73
+ s.add_development_dependency(%q<fakeweb-matcher>, [">= 0"])
74
+ s.add_development_dependency(%q<timecop>, [">= 0"])
75
+ s.add_development_dependency(%q<yajl-ruby>, [">= 0"])
78
76
  else
79
77
  s.add_dependency(%q<rspec>, [">= 0"])
80
- s.add_dependency(%q<cucumber>, [">= 0"])
81
- s.add_dependency(%q<tmail>, [">= 0"])
78
+ s.add_dependency(%q<activesupport>, [">= 0"])
79
+ s.add_dependency(%q<json>, [">= 0"])
80
+ s.add_dependency(%q<ruby-debug>, [">= 0"])
81
+ s.add_dependency(%q<fakeweb>, [">= 0"])
82
+ s.add_dependency(%q<fakeweb-matcher>, [">= 0"])
83
+ s.add_dependency(%q<timecop>, [">= 0"])
84
+ s.add_dependency(%q<yajl-ruby>, [">= 0"])
82
85
  end
83
86
  else
84
87
  s.add_dependency(%q<rspec>, [">= 0"])
85
- s.add_dependency(%q<cucumber>, [">= 0"])
86
- s.add_dependency(%q<tmail>, [">= 0"])
88
+ s.add_dependency(%q<activesupport>, [">= 0"])
89
+ s.add_dependency(%q<json>, [">= 0"])
90
+ s.add_dependency(%q<ruby-debug>, [">= 0"])
91
+ s.add_dependency(%q<fakeweb>, [">= 0"])
92
+ s.add_dependency(%q<fakeweb-matcher>, [">= 0"])
93
+ s.add_dependency(%q<timecop>, [">= 0"])
94
+ s.add_dependency(%q<yajl-ruby>, [">= 0"])
87
95
  end
88
96
  end
89
97
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 6
10
+ version: 0.9.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Petyo Ivanov
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-17 00:00:00 +07:00
19
+ date: 2011-02-23 00:00:00 +07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -34,7 +34,7 @@ dependencies:
34
34
  type: :development
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
37
- name: cucumber
37
+ name: activesupport
38
38
  prerelease: false
39
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
40
  none: false
@@ -48,7 +48,7 @@ dependencies:
48
48
  type: :development
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
51
- name: tmail
51
+ name: json
52
52
  prerelease: false
53
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
54
  none: false
@@ -59,10 +59,80 @@ dependencies:
59
59
  segments:
60
60
  - 0
61
61
  version: "0"
62
- type: :runtime
62
+ type: :development
63
63
  version_requirements: *id003
64
- description: Ruby gem for sending emails through http://postmarkapp.com HTTP API. It relieas on TMail::Mail for message construction.
65
- email: underlog@gmail.com
64
+ - !ruby/object:Gem::Dependency
65
+ name: ruby-debug
66
+ prerelease: false
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ type: :development
77
+ version_requirements: *id004
78
+ - !ruby/object:Gem::Dependency
79
+ name: fakeweb
80
+ prerelease: false
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ type: :development
91
+ version_requirements: *id005
92
+ - !ruby/object:Gem::Dependency
93
+ name: fakeweb-matcher
94
+ prerelease: false
95
+ requirement: &id006 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ type: :development
105
+ version_requirements: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ name: timecop
108
+ prerelease: false
109
+ requirement: &id007 !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
118
+ type: :development
119
+ version_requirements: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ name: yajl-ruby
122
+ prerelease: false
123
+ requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 0
131
+ version: "0"
132
+ type: :development
133
+ version_requirements: *id008
134
+ description: Use this gem to send emails through Postmark HTTP API and retrieve info about bounces.
135
+ email: ilya@wildbit.com
66
136
  executables: []
67
137
 
68
138
  extensions: []
@@ -73,18 +143,12 @@ extra_rdoc_files:
73
143
  files:
74
144
  - .bundle/config
75
145
  - .document
76
- - .gitignore
77
146
  - .rake_tasks
78
147
  - CHANGELOG.rdoc
79
- - Gemfile
80
- - Gemfile.lock
81
148
  - LICENSE
82
149
  - README.rdoc
83
150
  - Rakefile
84
151
  - VERSION
85
- - features/postmark.feature
86
- - features/step_definitions/postmark_steps.rb
87
- - features/support/env.rb
88
152
  - init.rb
89
153
  - lib/postmark.rb
90
154
  - lib/postmark/attachments_fix_for_mail.rb
@@ -108,8 +172,8 @@ homepage: http://postmarkapp.com
108
172
  licenses: []
109
173
 
110
174
  post_install_message: "\n ==================\n Thanks for installing the postmark gem. If you don't have an account, please sign up at http://postmarkapp.com/.\n Review the README.rdoc for implementation details and examples.\n ==================\n "
111
- rdoc_options:
112
- - --charset=UTF-8
175
+ rdoc_options: []
176
+
113
177
  require_paths:
114
178
  - lib
115
179
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -136,7 +200,7 @@ rubyforge_project:
136
200
  rubygems_version: 1.3.7
137
201
  signing_key:
138
202
  specification_version: 3
139
- summary: Ruby gem for sending emails through http://postmarkapp.com HTTP API
203
+ summary: Official Postmark API wrapper.
140
204
  test_files:
141
205
  - spec/bounce_spec.rb
142
206
  - spec/postmark_spec.rb
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg
data/Gemfile DELETED
@@ -1,18 +0,0 @@
1
- source :gemcutter
2
-
3
- gem "rake"
4
- gem "jeweler"
5
- gem "tmail"
6
- gem "mail"
7
-
8
- group :test do
9
- gem "rspec"
10
- gem "cucumber"
11
- gem "activesupport"
12
- gem "json"
13
- gem "ruby-debug"
14
- gem "fakeweb"
15
- gem "fakeweb-matcher"
16
- gem "timecop"
17
- gem "yajl-ruby"
18
- end
data/Gemfile.lock DELETED
@@ -1,68 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activesupport (2.3.8)
5
- builder (2.1.2)
6
- columnize (0.3.1)
7
- cucumber (0.8.5)
8
- builder (~> 2.1.2)
9
- diff-lcs (~> 1.1.2)
10
- gherkin (~> 2.1.4)
11
- json_pure (~> 1.4.3)
12
- term-ansicolor (~> 1.0.4)
13
- diff-lcs (1.1.2)
14
- fakeweb (1.3.0)
15
- fakeweb-matcher (1.1.0)
16
- fakeweb (>= 1.2.5)
17
- rspec (>= 1.2.0)
18
- gemcutter (0.6.1)
19
- gherkin (2.1.5)
20
- trollop (~> 1.16.2)
21
- git (1.2.5)
22
- jeweler (1.4.0)
23
- gemcutter (>= 0.1.0)
24
- git (>= 1.2.5)
25
- rubyforge (>= 2.0.0)
26
- json (1.4.6)
27
- json_pure (1.4.6)
28
- linecache (0.43)
29
- mail (2.2.5)
30
- activesupport (>= 2.3.6)
31
- mime-types
32
- treetop (>= 1.4.5)
33
- mime-types (1.16)
34
- polyglot (0.3.1)
35
- rake (0.8.7)
36
- rspec (1.3.0)
37
- ruby-debug (0.10.3)
38
- columnize (>= 0.1)
39
- ruby-debug-base (~> 0.10.3.0)
40
- ruby-debug-base (0.10.3)
41
- linecache (>= 0.3)
42
- rubyforge (2.0.4)
43
- json_pure (>= 1.1.7)
44
- term-ansicolor (1.0.5)
45
- timecop (0.3.5)
46
- tmail (1.2.7.1)
47
- treetop (1.4.8)
48
- polyglot (>= 0.3.1)
49
- trollop (1.16.2)
50
- yajl-ruby (0.7.7)
51
-
52
- PLATFORMS
53
- ruby
54
-
55
- DEPENDENCIES
56
- activesupport
57
- cucumber
58
- fakeweb
59
- fakeweb-matcher
60
- jeweler
61
- json
62
- mail
63
- rake
64
- rspec
65
- ruby-debug
66
- timecop
67
- tmail
68
- yajl-ruby
@@ -1,15 +0,0 @@
1
- Feature: sending emails through Postmark API
2
- In order to communicate effectively with the world
3
- My application should be able to deliver emails through the postmark API
4
-
5
- Background:
6
- Given the service listens to "http://postmarkapp.local"
7
- And I have an account with api key "mykey"
8
-
9
- Scenario: Sending simple email
10
- Given I send the following email:
11
- | From | leonard@bigbangtheory.com |
12
- | To | sheldon@bigbangtheory.com |
13
- | Subject | About that last night |
14
- | Body | Sorry for not coming |
15
- Then the service should receive an email on behalf of "mykey" for "sheldon@bigbangtheory.com"
File without changes
@@ -1,4 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
- require 'postmark'
3
-
4
- require 'spec/expectations'