soap_adapters 0.0.2 → 0.1.0
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.md +4 -0
- data/README.md +3 -1
- data/lib/soap_adapters/savon.rb +3 -1
- data/lib/soap_adapters/version.rb +1 -1
- data/soap_adapters.gemspec +2 -2
- data/spec/lib/soap_adapters/savon_spec.rb +15 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534f74d353fac6b0d638fe5e03cbb5730c35f693
|
4
|
+
data.tar.gz: 093d25f5ea4b1a6e705042e4bf214c923cac536c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaa20d318e9a230968c120ee90f3dbf559a75e0e986383d9d000cab6c0683d4b51c84fed61ffddc7f9b7c509946a5a386edef6f817583a8688f31e9a169160bc
|
7
|
+
data.tar.gz: 2661df4ba1a95bae17ec993b1d334de0fe931dac43f7324fa8a7b93f771cc49afac46948b7be05e3a66c5e1929bb419f4230abbcae7f9fe0848d17f5b42618ed
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,9 @@ adapter = SoapAdapters::Savon.new(
|
|
28
28
|
wsdl: "https://myservice.com?WSDL",
|
29
29
|
logger: MyLogger.new,
|
30
30
|
log: false,
|
31
|
-
ssl_version: :TLSv1, # optional; defaults to :TLSv1
|
31
|
+
ssl_version: :TLSv1, # optional; defaults to :TLSv1,
|
32
|
+
open_timeout: 30,
|
33
|
+
read_timeout: 10
|
32
34
|
)
|
33
35
|
|
34
36
|
response = adapter.call(:make_reservation, message: {username: "abc"})
|
data/lib/soap_adapters/savon.rb
CHANGED
@@ -2,13 +2,15 @@ module SoapAdapters
|
|
2
2
|
class Savon
|
3
3
|
|
4
4
|
include Virtus.model
|
5
|
-
CLIENT_ATTRS = %i[wsdl logger log ssl_version]
|
5
|
+
CLIENT_ATTRS = %i[wsdl logger log ssl_version open_timeout read_timeout]
|
6
6
|
|
7
7
|
attribute :wsdl, String
|
8
8
|
attribute :logger
|
9
9
|
attribute :log, Boolean, default: true
|
10
10
|
attribute :ssl_version, Symbol, default: :TLSv1
|
11
11
|
attribute :last_request, String
|
12
|
+
attribute :open_timeout, Integer
|
13
|
+
attribute :read_timeout, Integer
|
12
14
|
|
13
15
|
def ssl_version
|
14
16
|
@ssl_version || :TLSv1
|
data/soap_adapters.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'soap_adapters/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "soap_adapters"
|
8
8
|
spec.version = SoapAdapters::VERSION
|
9
|
-
spec.authors = ["G5", "Ramon Tayag"]
|
10
|
-
spec.email = ["ramon.tayag@gmail.com", "
|
9
|
+
spec.authors = ["G5", "Ramon Tayag", "Michael Mitchell"]
|
10
|
+
spec.email = ["ramon.tayag@gmail.com", "michael.mitchell@gmail.com"]
|
11
11
|
spec.summary = %q{Common interface to soap clients}
|
12
12
|
spec.description = %q{Common interface to soap clients}
|
13
13
|
spec.homepage = ""
|
@@ -61,6 +61,21 @@ describe SoapAdapters::Savon do
|
|
61
61
|
expect(r.to_s).to eq "response_xml"
|
62
62
|
expect(r.xml).to eq "response_xml"
|
63
63
|
end
|
64
|
+
|
65
|
+
it "sets the open_timeout and read_timeout if declared" do
|
66
|
+
allow(::Savon).to receive(:client).with(
|
67
|
+
wsdl: "wsdl",
|
68
|
+
log: false,
|
69
|
+
ssl_version: :TLSv1,
|
70
|
+
open_timeout: 30,
|
71
|
+
read_timeout: 10
|
72
|
+
).and_return(client)
|
73
|
+
adapter = described_class.new(wsdl: "wsdl", log: false, open_timeout: 30, read_timeout: 10)
|
74
|
+
r = adapter.call(*client_args)
|
75
|
+
expect(adapter.last_request).to eq "request_xml"
|
76
|
+
expect(r.to_s).to eq "response_xml"
|
77
|
+
expect(r.xml).to eq "response_xml"
|
78
|
+
end
|
64
79
|
end
|
65
80
|
|
66
81
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soap_adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- G5
|
8
8
|
- Ramon Tayag
|
9
|
+
- Michael Mitchell
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: virtus
|
@@ -98,7 +99,7 @@ dependencies:
|
|
98
99
|
description: Common interface to soap clients
|
99
100
|
email:
|
100
101
|
- ramon.tayag@gmail.com
|
101
|
-
-
|
102
|
+
- michael.mitchell@gmail.com
|
102
103
|
executables: []
|
103
104
|
extensions: []
|
104
105
|
extra_rdoc_files: []
|
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
137
|
version: '0'
|
137
138
|
requirements: []
|
138
139
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.5.1
|
140
141
|
signing_key:
|
141
142
|
specification_version: 4
|
142
143
|
summary: Common interface to soap clients
|