postmark 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,8 +47,10 @@ You can also explicitly specify which one to be used, using
47
47
  Postmark.response_parser_class = :Json # :ActiveSupport or :Yajl is also supported.
48
48
 
49
49
  == Limitations
50
- Currently postmark API does not support multiple recipients, or attachments. For more information, check the docs here:
51
- TODO: URL to docs.
50
+
51
+ Currently postmark API does not support multiple recipients, or attachments. For more information, check the docs at:
52
+
53
+ http://developer.postmarkapp.com
52
54
 
53
55
  == Note on Patches/Pull Requests
54
56
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -131,7 +131,6 @@ module Postmark
131
131
  end
132
132
 
133
133
  def extract_headers(message)
134
- bogus_headers = %w[from to subject reply-to]
135
134
  headers = []
136
135
  message.each_header do |key, value|
137
136
  next if bogus_headers.include? key.downcase
@@ -140,6 +139,22 @@ module Postmark
140
139
  headers
141
140
  end
142
141
 
142
+ def bogus_headers
143
+ %q[
144
+ return-path
145
+ x-pm-rcpt
146
+ from
147
+ reply-to
148
+ sender
149
+ received
150
+ date
151
+ content-type
152
+ cc
153
+ bcc
154
+ subject
155
+ ]
156
+ end
157
+
143
158
  end
144
159
 
145
160
  self.response_parser_class = nil
@@ -3,8 +3,8 @@ module Postmark
3
3
  module ResponseParsers
4
4
  module ActiveSupport
5
5
  def self.decode(data)
6
- ActiveSupport::JSON.decode(data)
6
+ ::ActiveSupport::JSON.decode(data)
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postmark}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
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"]
12
- s.date = %q{2010-01-04}
12
+ s.date = %q{2010-01-13}
13
13
  s.description = %q{Ruby gem for sending emails through http://postmarkapp.com HTTP API. It relieas on TMail::Mail for message construction.}
14
14
  s.email = %q{underlog@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -126,10 +126,12 @@ describe "Postmark" do
126
126
  [:Json, :ActiveSupport, :Yajl].each do |lib|
127
127
  begin
128
128
  original_parser_class = Postmark.response_parser_class
129
- Postmark.response_parser_class = lib
130
- it "parses error message with #{lib}" do
131
- Postmark.error_message(%({"Message":"OK"})).should == "OK"
129
+
130
+ it "decodes json with #{lib}" do
131
+ Postmark.response_parser_class = lib
132
+ Postmark.decode_json(%({"Message":"OK"})).should == { "Message" => "OK" }
132
133
  end
134
+
133
135
  Postmark.response_parser_class = original_parser_class
134
136
  rescue LoadError # No ActiveSupport or Yajl :(
135
137
  end
@@ -2,6 +2,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'postmark'
4
4
  require 'rubygems'
5
+ require 'active_support'
5
6
  require 'json'
6
7
  require 'ruby-debug'
7
8
  require 'spec'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petyo Ivanov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-04 00:00:00 +02:00
12
+ date: 2010-01-13 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency