postmark 1.9.0 → 1.9.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +5 -0
- data/VERSION +1 -1
- data/lib/postmark/http_client.rb +5 -5
- data/lib/postmark/version.rb +1 -1
- data/spec/unit/postmark/http_client_spec.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76623008dfbb09504295182472b645b013700da6
|
4
|
+
data.tar.gz: 8648dba9d5ed435d630493777d8b42552369df54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6b5c6789fa0d38c1d4ba35a426febce12b11c3bd09a9450e388d9cf1c17d2c5312ae67611e33d9d2cc750173e2020c86920b4100ea9f46b7a847e18cfe88fd6
|
7
|
+
data.tar.gz: e3324835f12c6a203fdc78147a400c039714d5a0045917823b95d4bdd2890f7afbad80ab7a816aaea12785ba2c6cee62132016ec25eb3ad027ce86b481ee0782
|
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.1
|
data/lib/postmark/http_client.rb
CHANGED
@@ -42,6 +42,10 @@ module Postmark
|
|
42
42
|
do_request { |client| client.delete(url_path(path + to_query_string(query)), headers) }
|
43
43
|
end
|
44
44
|
|
45
|
+
def protocol
|
46
|
+
self.secure ? 'https' : 'http'
|
47
|
+
end
|
48
|
+
|
45
49
|
protected
|
46
50
|
|
47
51
|
def apply_options(options = {})
|
@@ -49,7 +53,7 @@ module Postmark
|
|
49
53
|
DEFAULTS.merge(options).each_pair do |name, value|
|
50
54
|
instance_variable_set(:"@#{name}", value)
|
51
55
|
end
|
52
|
-
@port = options[:port] || @secure ? 443 : 80
|
56
|
+
@port = options[:port] || (@secure ? 443 : 80)
|
53
57
|
end
|
54
58
|
|
55
59
|
def to_query_string(hash)
|
@@ -57,10 +61,6 @@ module Postmark
|
|
57
61
|
"?" + hash.map { |key, value| "#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}" }.join("&")
|
58
62
|
end
|
59
63
|
|
60
|
-
def protocol
|
61
|
-
self.secure ? "https" : "http"
|
62
|
-
end
|
63
|
-
|
64
64
|
def url
|
65
65
|
URI.parse("#{protocol}://#{self.host}:#{self.port}/")
|
66
66
|
end
|
data/lib/postmark/version.rb
CHANGED
@@ -54,7 +54,7 @@ describe Postmark::HttpClient do
|
|
54
54
|
let(:proxy_user) { "provided proxy user" }
|
55
55
|
let(:proxy_pass) { "provided proxy pass" }
|
56
56
|
let(:host) { "providedhostname.org" }
|
57
|
-
let(:port) {
|
57
|
+
let(:port) { 4443 }
|
58
58
|
let(:path_prefix) { "/provided/path/prefix" }
|
59
59
|
let(:http_open_timeout) { 42 }
|
60
60
|
let(:http_read_timeout) { 42 }
|
@@ -83,6 +83,20 @@ describe Postmark::HttpClient do
|
|
83
83
|
its(:path_prefix) { should == path_prefix }
|
84
84
|
its(:http_open_timeout) { should == http_open_timeout }
|
85
85
|
its(:http_read_timeout) { should == http_read_timeout }
|
86
|
+
|
87
|
+
it 'uses port 80 for plain HTTP connections' do
|
88
|
+
expect(Postmark::HttpClient.new(api_token, :secure => false).port).to eq(80)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'uses port 443 for secure HTTP connections' do
|
92
|
+
expect(Postmark::HttpClient.new(api_token, :secure => true).port).to eq(443)
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'respects port over secure option' do
|
96
|
+
client = Postmark::HttpClient.new(api_token, :port => 80, :secure => true)
|
97
|
+
expect(client.port).to eq(80)
|
98
|
+
expect(client.protocol).to eq('https')
|
99
|
+
end
|
86
100
|
end
|
87
101
|
|
88
102
|
describe "#post" do
|
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: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petyo Ivanov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-10-
|
13
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|