stockboy 1.0.1 → 1.1.0

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: db81b34ead77c1f6fffbb45024f491c55629fcbc
4
- data.tar.gz: a9550b87a91852566538b53b093a15b4e947848a
3
+ metadata.gz: 7f65df7318f49c88b008b2ee6539b4c32d5bd444
4
+ data.tar.gz: ad26b53bcd6f495a5674708922ed41c6fc7a8b69
5
5
  SHA512:
6
- metadata.gz: ff71d14c0227d969fca699b2a40439855600d4176174073ba4d2679b790d77694ae740489622a791989fb04e92215c0bb49e21ba5c524a156f780d6b234cbe8c
7
- data.tar.gz: a8a4c0b192d096253b5e68ae1ac3e58dc69a66dc2dbad3f44cfacffb9d886f5d2a2899ff252ec3dbe8e12ddd338f8da76938819a701d88df5f28ad5b968ccbd9
6
+ metadata.gz: 97195c3f0d8b9b98b00657fdd035e5b4e3d9804bad40c186103a54dd6344472723a1c9703e259ba57e030a4560f8888513efc8079d6724648c60ff7178035d2f
7
+ data.tar.gz: ff23c429b975eba2c558aa376debe315f9e771e9af087aa15200335905ed5ceaff4363bed0acfd5b7c4b37caf5bfa1792a833db1bbd7dfbed3c8f78df560a660
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 / 2016-02-19
4
+
5
+ * [ENHANCEMENT] Allow `:read_timeout` and `:open_timeout` on SOAP connections
6
+
3
7
  ## 1.0.1 / 2015-12-16
4
8
 
5
9
  * [ENHANCEMENT] Add `:json` as a standard registered reader
@@ -164,7 +164,7 @@ module Stockboy::Providers
164
164
  rescue ::Net::IMAP::Error => e
165
165
  errors << "IMAP connection error"
166
166
  ensure
167
- if first_connection
167
+ if first_connection && @open_client
168
168
  @open_client.disconnect
169
169
  @open_client = nil
170
170
  end
@@ -25,6 +25,24 @@ module Stockboy::Providers
25
25
  #
26
26
  dsl_attr :wsdl
27
27
 
28
+ # Maximum time to establish a connection
29
+ #
30
+ # @!attribute [rw] open_timeout
31
+ # @return [Fixnum]
32
+ # @example
33
+ # open_timeout 10
34
+ #
35
+ dsl_attr :open_timeout
36
+
37
+ # Maximum time to read data from connection
38
+ #
39
+ # @!attribute [rw] read_timeout
40
+ # @return [Fixnum]
41
+ # @example
42
+ # read_timeout 10
43
+ #
44
+ dsl_attr :read_timeout
45
+
28
46
  # The name of the request, see your SOAP documentation
29
47
  #
30
48
  # @!attribute [rw] request
@@ -159,6 +177,8 @@ module Stockboy::Providers
159
177
  elsif endpoint
160
178
  {endpoint: endpoint}
161
179
  end
180
+ opts[:open_timeout] = open_timeout if open_timeout
181
+ opts[:read_timeout] = read_timeout if read_timeout
162
182
  opts[:logger] = logger
163
183
  opts[:convert_response_tags_to] = ->(tag) { string_pool(tag) }
164
184
  opts[:namespace] = namespace if namespace
@@ -1,3 +1,3 @@
1
1
  module Stockboy
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -30,6 +30,8 @@ module Stockboy
30
30
  p.endpoint = "http://api.example.com/v1"
31
31
  p.namespace = "http://api.example.com/namespace"
32
32
  p.wsdl = "http://api.example.com/?wsdl"
33
+ p.open_timeout = 13
34
+ p.read_timeout = 99
33
35
  p.message = {user: 'u', pass: 'p'}
34
36
  p.headers = {key: 'k'}
35
37
  end
@@ -37,6 +39,8 @@ module Stockboy
37
39
  provider.request.should == :get_user
38
40
  provider.endpoint.should == "http://api.example.com/v1"
39
41
  provider.wsdl.should == "http://api.example.com/?wsdl"
42
+ provider.open_timeout.should == 13
43
+ provider.read_timeout.should == 99
40
44
  provider.namespace.should == "http://api.example.com/namespace"
41
45
  provider.message.should == {user: 'u', pass: 'p'}
42
46
  provider.headers.should == {key: 'k'}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stockboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Vit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake