allq_rest 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +25 -27
- data/deploy.sh +1 -1
- data/lib/.DS_Store +0 -0
- data/lib/allq_rest/api_client.rb +4 -3
- data/lib/allq_rest/configuration.rb +2 -2
- data/lib/allq_rest/version.rb +1 -1
- data/spec/api/actions_api_spec.rb +6 -1
- data/spec/configuration_spec.rb +5 -5
- metadata +15 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f55e879b91c3a2dc0a61a07171b1041b8152ef2b891b59f29fcf42e6725b49
|
4
|
+
data.tar.gz: 9ec0cbcf16f8dfd88079ae97d4683e72b70b08ecc50da0009ec417dbaaa28797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02315f7eef21593c11f648420de41805a25e53bcdf9b1a7bfb31ad2095e152f9f9abfaa467a25d9bebbaaf883fd3be76eef2b26981b36fd17996fded6fcf701c
|
7
|
+
data.tar.gz: 7762dbc876c63660a97036c6b709bdb4fb72bfb476d0eb9192bb97df8025313e15c5caf655c477fe8a05f5e6ed614b6a73db7d7b4e3fb2e080dd7796dd20b7aa
|
data/Gemfile.lock
CHANGED
@@ -1,49 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
allq_rest (1.
|
4
|
+
allq_rest (1.2.2)
|
5
5
|
json (~> 2.1, >= 2.1.0)
|
6
6
|
typhoeus (~> 1.0, >= 1.0.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
ZenTest (4.
|
12
|
-
addressable (2.
|
13
|
-
public_suffix (>= 2.0.2, <
|
11
|
+
ZenTest (4.12.0)
|
12
|
+
addressable (2.7.0)
|
13
|
+
public_suffix (>= 2.0.2, < 5.0)
|
14
14
|
autotest (4.4.6)
|
15
15
|
ZenTest (>= 4.4.1)
|
16
|
-
autotest-fsevent (0.2.
|
16
|
+
autotest-fsevent (0.2.17)
|
17
17
|
sys-uname
|
18
18
|
autotest-growl (0.2.16)
|
19
19
|
autotest-rails-pure (4.1.2)
|
20
20
|
crack (0.4.3)
|
21
21
|
safe_yaml (~> 1.0.0)
|
22
|
-
diff-lcs (1.
|
23
|
-
ethon (0.
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
ethon (0.12.0)
|
24
24
|
ffi (>= 1.3.0)
|
25
|
-
ffi (1.
|
26
|
-
hashdiff (0.
|
27
|
-
json (2.1
|
28
|
-
public_suffix (
|
25
|
+
ffi (1.13.1)
|
26
|
+
hashdiff (1.0.1)
|
27
|
+
json (2.3.1)
|
28
|
+
public_suffix (4.0.6)
|
29
29
|
rake (12.0.0)
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.
|
32
|
-
rspec-expectations (~> 3.
|
33
|
-
rspec-mocks (~> 3.
|
34
|
-
rspec-core (3.
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-expectations (3.
|
30
|
+
rspec (3.9.0)
|
31
|
+
rspec-core (~> 3.9.0)
|
32
|
+
rspec-expectations (~> 3.9.0)
|
33
|
+
rspec-mocks (~> 3.9.0)
|
34
|
+
rspec-core (3.9.2)
|
35
|
+
rspec-support (~> 3.9.3)
|
36
|
+
rspec-expectations (3.9.2)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
38
|
+
rspec-support (~> 3.9.0)
|
39
|
+
rspec-mocks (3.9.1)
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
43
|
-
safe_yaml (1.0.
|
44
|
-
sys-uname (1.
|
41
|
+
rspec-support (~> 3.9.0)
|
42
|
+
rspec-support (3.9.3)
|
43
|
+
safe_yaml (1.0.5)
|
44
|
+
sys-uname (1.2.1)
|
45
45
|
ffi (>= 1.0.0)
|
46
|
-
typhoeus (1.
|
46
|
+
typhoeus (1.4.0)
|
47
47
|
ethon (>= 0.9.0)
|
48
48
|
vcr (3.0.3)
|
49
49
|
webmock (1.24.6)
|
@@ -65,5 +65,3 @@ DEPENDENCIES
|
|
65
65
|
vcr (~> 3.0, >= 3.0.1)
|
66
66
|
webmock (~> 1.24, >= 1.24.3)
|
67
67
|
|
68
|
-
BUNDLED WITH
|
69
|
-
1.16.2
|
data/deploy.sh
CHANGED
data/lib/.DS_Store
CHANGED
Binary file
|
data/lib/allq_rest/api_client.rb
CHANGED
@@ -16,6 +16,7 @@ require 'logger'
|
|
16
16
|
require 'tempfile'
|
17
17
|
require 'typhoeus'
|
18
18
|
require 'uri'
|
19
|
+
require 'cgi'
|
19
20
|
|
20
21
|
module Allq
|
21
22
|
class ApiClient
|
@@ -27,7 +28,7 @@ module Allq
|
|
27
28
|
# @return [Hash]
|
28
29
|
attr_accessor :default_headers
|
29
30
|
|
30
|
-
# Initializes the
|
31
|
+
# Initializes the ApiClient
|
31
32
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
33
|
def initialize(config = Configuration.default)
|
33
34
|
@config = config
|
@@ -39,7 +40,7 @@ module Allq
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def self.default
|
42
|
-
@@default ||=
|
43
|
+
@@default ||= ApiClient.new
|
43
44
|
end
|
44
45
|
|
45
46
|
# Call an API with given options.
|
@@ -263,7 +264,7 @@ module Allq
|
|
263
264
|
def build_request_url(path)
|
264
265
|
# Add leading and trailing slashes to path
|
265
266
|
path = "/#{path}".gsub(/\/+/, '/')
|
266
|
-
|
267
|
+
CGI.escape(@config.base_url + path)
|
267
268
|
end
|
268
269
|
|
269
270
|
# Builds the HTTP request body
|
@@ -10,7 +10,7 @@ Swagger Codegen version: 2.4.2
|
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module Allq
|
16
16
|
class Configuration
|
@@ -175,7 +175,7 @@ module Allq
|
|
175
175
|
|
176
176
|
def base_url
|
177
177
|
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
178
|
-
|
178
|
+
CGI.escape(url)
|
179
179
|
end
|
180
180
|
|
181
181
|
# Gets API key (with prefix if set).
|
data/lib/allq_rest/version.rb
CHANGED
@@ -21,7 +21,12 @@ ALT_TUBE = ""
|
|
21
21
|
describe 'ActionsApi' do
|
22
22
|
before do
|
23
23
|
# run before each test
|
24
|
-
|
24
|
+
allq_conf = Allq::Configuration.new do |config|
|
25
|
+
config.host = ENV['ALLQ_CLIENT_LOCATION'] || 'localhost:8091'
|
26
|
+
end
|
27
|
+
|
28
|
+
raw_client = Allq::ApiClient.new(allq_conf)
|
29
|
+
@instance = Allq::ActionsApi.new(raw_client)
|
25
30
|
stats_result = AllQTools::get_stats[0]
|
26
31
|
stats_result.stats.each do |stat|
|
27
32
|
@instance.tube_delete(stat.tube)
|
data/spec/configuration_spec.rb
CHANGED
@@ -18,11 +18,11 @@ describe Allq::Configuration do
|
|
18
18
|
before(:each) do
|
19
19
|
# uncomment below to setup host and base_path
|
20
20
|
#require 'URI'
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
uri = URI.parse("http://localhost:8091")
|
22
|
+
Allq.configure do |c|
|
23
|
+
c.host = uri.host
|
24
|
+
c.base_path = uri.path
|
25
|
+
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '#base_url' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allq_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- support@blitline.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -34,42 +34,42 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 2.1.0
|
40
37
|
- - "~>"
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: '2.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.1.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 2.1.0
|
50
47
|
- - "~>"
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: '2.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.1.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 3.6.0
|
60
57
|
- - "~>"
|
61
58
|
- !ruby/object:Gem::Version
|
62
59
|
version: '3.6'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.6.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 3.6.0
|
70
67
|
- - "~>"
|
71
68
|
- !ruby/object:Gem::Version
|
72
69
|
version: '3.6'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.6.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: vcr
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,8 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
|
277
|
-
rubygems_version: 2.7.9
|
276
|
+
rubygems_version: 3.2.3
|
278
277
|
signing_key:
|
279
278
|
specification_version: 4
|
280
279
|
summary: Ruby REST client for Allq platform
|