soaspec 0.0.86 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/soaspec/exchange_handlers/rest_accessors.rb +5 -7
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -4
- data/.travis.yml +0 -5
- data/test_rest.rb +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7463616264d1315b533bf2005c8ddafcc8f8f1d4
|
4
|
+
data.tar.gz: b02119b036570ab8fcdeeba446cd1148e4a182d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60c36c8a0c9b98e4ebae2682dcd58a63bedd129f96235d30d89dcdbf540f7f4892a9f1e7cbfe2ac4b68067b231174f2a63d25b9bcb52b4e7fb81911b59c87745
|
7
|
+
data.tar.gz: 14fcfaa2252feb628bdd695664915d7822ee500aa53b6bf19d95f8fce420100b247b9a80d14bdd2e418ac7e38af8442edeb67271e8efeb023d987c7b74def480
|
data/ChangeLog
CHANGED
@@ -10,8 +10,6 @@ module Soaspec
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
13
|
# Will create access_token method based on passed parameters
|
16
14
|
# @param [Hash] params Params client_id: nil, client_secret: nil, token_url: nil, username: nil, password: nil, security_token: nil
|
17
15
|
def oauth2(params)
|
@@ -40,11 +38,11 @@ module Soaspec
|
|
40
38
|
params[:token_url] = ERB.new(params[:token_url]).result(binding) if params[:token_url]
|
41
39
|
params[:password] = ERB.new(params[:password]).result(binding) if params[:password]
|
42
40
|
payload = oauth_payload(params)
|
43
|
-
if Soaspec.debug_oauth?
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
request_message = if Soaspec.debug_oauth?
|
42
|
+
"request_params: #{payload}"
|
43
|
+
else
|
44
|
+
params[:username] ? "User '#{params[:username]}'" : 'client_credentials'
|
45
|
+
end
|
48
46
|
Soaspec::SpecLogger.info request_message
|
49
47
|
retry_count = 0
|
50
48
|
begin
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.87
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -291,7 +291,6 @@ files:
|
|
291
291
|
- ".gitlab-ci.yml"
|
292
292
|
- ".rspec"
|
293
293
|
- ".rubocop.yml"
|
294
|
-
- ".travis.yml"
|
295
294
|
- CODE_OF_CONDUCT.md
|
296
295
|
- ChangeLog
|
297
296
|
- Gemfile
|
@@ -343,7 +342,6 @@ files:
|
|
343
342
|
- soaspec.gemspec
|
344
343
|
- test.wsdl
|
345
344
|
- test.xml
|
346
|
-
- test_rest.rb
|
347
345
|
- test_wsdl.rb
|
348
346
|
homepage: https://gitlab.com/samuel-garratt/soaspec
|
349
347
|
licenses:
|
data/.travis.yml
DELETED
data/test_rest.rb
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'rest-client'
|
3
|
-
require 'json'
|
4
|
-
require 'data_magic'
|
5
|
-
|
6
|
-
options = {
|
7
|
-
headers: {
|
8
|
-
# accept: "application/xml",
|
9
|
-
accept: "application/json",
|
10
|
-
content_type: "application/json"
|
11
|
-
# log: Logger.new('logs/traffic.log')
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
RestClient.log = Logger.new('logs/traffic.log')
|
16
|
-
|
17
|
-
data_string = <<-EOF
|
18
|
-
{
|
19
|
-
"id": 1,
|
20
|
-
"category": {
|
21
|
-
"id": 1,
|
22
|
-
"name": "string"
|
23
|
-
},
|
24
|
-
"name": "test_rest",
|
25
|
-
"photoUrls": [
|
26
|
-
"string"
|
27
|
-
],
|
28
|
-
"tags": [
|
29
|
-
{
|
30
|
-
"id": 1,
|
31
|
-
"name": "string"
|
32
|
-
}
|
33
|
-
],
|
34
|
-
"status": "sold"
|
35
|
-
}
|
36
|
-
EOF
|
37
|
-
|
38
|
-
|
39
|
-
data = {
|
40
|
-
'id' => '1',
|
41
|
-
'category' => {
|
42
|
-
'id' => '1',
|
43
|
-
'name' => "string"
|
44
|
-
},
|
45
|
-
'name' => "test_rest",
|
46
|
-
'photoUrls' => [
|
47
|
-
"string"
|
48
|
-
],
|
49
|
-
'tags' => [
|
50
|
-
{
|
51
|
-
'id' => '1',
|
52
|
-
'name' => "string"
|
53
|
-
}
|
54
|
-
],
|
55
|
-
'status' => "sold"
|
56
|
-
}
|
57
|
-
|
58
|
-
# puts data.to_s
|
59
|
-
#
|
60
|
-
|
61
|
-
include DataMagic
|
62
|
-
|
63
|
-
id = '1'
|
64
|
-
default = data_for 'default/pet'
|
65
|
-
merged_result = default.merge({ 'id' => id })
|
66
|
-
|
67
|
-
#converted_data = JSON.generate(data).to_s
|
68
|
-
converted_data = JSON.generate(merged_result).to_s
|
69
|
-
|
70
|
-
puts converted_data
|
71
|
-
# puts 'data'
|
72
|
-
# puts data_string
|
73
|
-
|
74
|
-
resource = RestClient::Resource.new('http://petstore.swagger.io/v2', options)
|
75
|
-
# begin
|
76
|
-
# response = resource['pet'].post(data)
|
77
|
-
# rescue RestClient::ExceptionWithResponse => e
|
78
|
-
# puts e.response
|
79
|
-
# end
|
80
|
-
|
81
|
-
begin
|
82
|
-
#response = resource['store/order/1'].get
|
83
|
-
#response = resource['store/inventory'].get
|
84
|
-
#
|
85
|
-
#response = resource['pet/findByStatus?status=sold'].get(accept: 'application/xml')
|
86
|
-
|
87
|
-
|
88
|
-
#response = resource['pet'].post(data_string)
|
89
|
-
#response = resource['pet'].post(converted_data)
|
90
|
-
response = resource['pet/' + id].get
|
91
|
-
#response = resource['pet/' + id].delete
|
92
|
-
rescue RestClient::ExceptionWithResponse => e
|
93
|
-
puts e.response
|
94
|
-
end
|
95
|
-
|
96
|
-
puts response.body
|
97
|
-
puts response.code
|
98
|
-
puts response.request
|