postmark 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0db315ab0a2f924dca2620b8fc4d18f8c07445e5
4
- data.tar.gz: 9a322908b988cd2e61126a16359ec95ad02cd391
3
+ metadata.gz: 76623008dfbb09504295182472b645b013700da6
4
+ data.tar.gz: 8648dba9d5ed435d630493777d8b42552369df54
5
5
  SHA512:
6
- metadata.gz: 1ae0e033687041435061769f2d9e39cbe3de8cf1d46e5939c808aeaa69f88ad844eb9578d1d3cf8babbeae355d64223b4355edfb17c58fee4778d933c5537c4b
7
- data.tar.gz: 7adbede1755f986942d4260cc44c4d96e2ac03aeea90804162a352184d17f75a4dbfca7348950ada41df6f468092e004cb82c8980086ad5d626dc6423ed3c4c4
6
+ metadata.gz: f6b5c6789fa0d38c1d4ba35a426febce12b11c3bd09a9450e388d9cf1c17d2c5312ae67611e33d9d2cc750173e2020c86920b4100ea9f46b7a847e18cfe88fd6
7
+ data.tar.gz: e3324835f12c6a203fdc78147a400c039714d5a0045917823b95d4bdd2890f7afbad80ab7a816aaea12785ba2c6cee62132016ec25eb3ad027ce86b481ee0782
@@ -1,5 +1,10 @@
1
1
  = Changelog
2
2
 
3
+ == 1.9.1
4
+
5
+ * Fix a bug when port setting is not respected.
6
+ * Made `Postmark::HttpClient#protocol` method public.
7
+
3
8
  == 1.9.0
4
9
 
5
10
  * Added methods to access domains API endoints
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.0
1
+ 1.9.1
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Postmark
2
- VERSION = '1.9.0'
2
+ VERSION = '1.9.1'
3
3
  end
@@ -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) { 443 }
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.0
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-21 00:00:00.000000000 Z
13
+ date: 2016-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake