diplomat 1.1.0 → 1.2.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: 781ef66fd58770259245d9d3624499232db1cdbe
4
- data.tar.gz: cffd83536d1936f5f1189129fbf1d238a1555c8b
3
+ metadata.gz: 6feb74783d35459eb7f08e895688ffe20ed975b1
4
+ data.tar.gz: 21a8d4d02987f5d6298414c047fa86758968dd58
5
5
  SHA512:
6
- metadata.gz: b5b01504b9b8c7f8aac4f08e13837a36018ea7005a198e4d0dfba97568ff65f3417ed8ef33d061f2a2a2ba5adb421ad7ef691018f0e7883a714a798e0a823f1d
7
- data.tar.gz: 38034ad0d2add4cbb6368ba65af19c6ee066daa56b39fa8a3f12674d269240527e75765fd4648c17b2ca3b4de556299ed556e55d27475e6e72dc59a30b26e21e
6
+ metadata.gz: 709cdba5352b6c9f045065e8d335d4ce00d3b0065d0dbba39b83ed1d0ba8ea873088de4dd7b998fd127682dcd40104d5726daf91e9af40a45c13a2837c8240f9
7
+ data.tar.gz: 0621ad4ca2152759913a2e82f6daf650e2044bb2083f66b028caa73bac19e38f7cefcf044f1e73d79c4edbf1b1a9d1a2e40d0d82b43be58f51d91064d9d50f45
@@ -1,22 +1,24 @@
1
1
  require 'diplomat'
2
- Given /^I am setting up a default diplomat$/ do
2
+
3
+ Given 'I am setting up a default diplomat' do
3
4
  end
4
5
 
5
- Given /^I am setting up a custom diplomat$/ do
6
- class StubMiddleware
6
+ Given 'I am setting up a custom diplomat' do
7
+ class StubMiddleware # :nodoc:
7
8
  def initialize(app, options = {})
8
9
  @app = app
9
10
  @options = options
10
11
  end
12
+
11
13
  def call(env)
12
14
  @app.call(env)
13
15
  end
14
16
  end
15
17
 
16
- expect {
18
+ expect do
17
19
  Diplomat.configure do |config|
18
- config.url = "http://localhost:8500"
20
+ config.url = 'http://localhost:8500'
19
21
  config.middleware = StubMiddleware
20
22
  end
21
- }.to_not raise_error
23
+ end.to_not raise_error
22
24
  end
@@ -1,7 +1,7 @@
1
- Then /^I should be able to get and put keys$/ do
1
+ Then 'I should be able to get and put keys' do
2
2
  # High-fructose Corn Syrup
3
3
  Diplomat.put('drink', 'Irn Bru')
4
- expect(Diplomat.get('drink')).to eq("Irn Bru")
4
+ expect(Diplomat.get('drink')).to eq('Irn Bru')
5
5
 
6
6
  # Sugar
7
7
  Diplomat::Kv.put('cake', 'Sponge')
@@ -1,7 +1,10 @@
1
- module Diplomat
1
+ require 'json'
2
+ require 'base64'
3
+ require 'faraday'
2
4
 
5
+ # Top level namespace ensures all required libraries are included and initializes the gem configration.
6
+ module Diplomat
3
7
  class << self
4
-
5
8
  attr_accessor :root_path
6
9
  attr_accessor :lib_path
7
10
  attr_accessor :configuration
@@ -20,16 +23,15 @@ module Diplomat
20
23
 
21
24
  raise 'Diplomat only supports ruby >= 2.0.0' unless RUBY_VERSION.to_f >= 2.0
22
25
 
23
- self.root_path = File.expand_path "..", __FILE__
24
- self.lib_path = File.expand_path "../diplomat", __FILE__
26
+ self.root_path = File.expand_path '..', __FILE__
27
+ self.lib_path = File.expand_path '../diplomat', __FILE__
25
28
 
26
- require_libs "configuration", "rest_client", "api_options", "kv", "datacenter",
27
- "service", "members", "node", "nodes", "check", "health", "session", "lock",
28
- "error", "event", "acl", "maintenance"
29
+ require_libs 'configuration', 'rest_client', 'api_options', 'kv', 'datacenter',
30
+ 'service', 'members', 'node', 'nodes', 'check', 'health', 'session', 'lock',
31
+ 'error', 'event', 'acl', 'maintenance', 'query'
29
32
  self.configuration ||= Diplomat::Configuration.new
30
33
 
31
34
  class << self
32
-
33
35
  # Build optional configuration by yielding a block to configure
34
36
  # @yield [Diplomat::Configuration]
35
37
  def configure
@@ -46,7 +48,15 @@ module Diplomat
46
48
  # @param &block block to send to Kv
47
49
  # @return [Object]
48
50
  def method_missing(name, *args, &block)
49
- Diplomat::Kv.new.send(name, *args, &block)
51
+ Diplomat::Kv.new.send(name, *args, &block) || super
52
+ end
53
+
54
+ # Make `respond_to_missing?` fall back to super
55
+ #
56
+ # @param meth_id [Symbol] the tested method
57
+ # @oaram with_private if private methods should be tested too
58
+ def respond_to_missing?(meth_id, with_private = false)
59
+ access_method?(meth_id) || super
50
60
  end
51
61
  end
52
62
  end
@@ -1,94 +1,92 @@
1
- require 'base64'
2
- require 'faraday'
3
-
4
1
  module Diplomat
2
+ # Methods for interacting with the Consul ACL API endpoint
5
3
  class Acl < Diplomat::RestClient
6
-
7
4
  include ApiOptions
8
5
 
9
- @access_methods = [ :list, :info, :create, :destroy, :update ]
6
+ @access_methods = [:list, :info, :create, :destroy, :update]
10
7
  attr_reader :id, :type, :acl
11
8
 
12
9
  # Get Acl info by ID
13
10
  # @param id [String] ID of the Acl to get
14
11
  # @return [Hash]
15
- def info id, options=nil, not_found=:reject, found=:return
12
+ # rubocop:disable PerceivedComplexity, MethodLength, CyclomaticComplexity, AbcSize
13
+ def info(id, options = nil, not_found = :reject, found = :return)
16
14
  @id = id
17
15
  @options = options
18
-
19
- url = ["/v1/acl/info/#{@id}"]
20
- url += check_acl_token
21
- url += use_consistency(@options)
16
+ url = ["/v1/acl/info/#{id}"]
17
+ url << check_acl_token
18
+ url << use_consistency(options)
22
19
 
23
20
  raw = @conn_no_err.get concat_url url
24
- if raw.status == 200 and raw.body != "null"
21
+ if raw.status == 200 && raw.body != 'null'
25
22
  case found
26
- when :reject
27
- raise Diplomat::AclAlreadyExists, @id
28
- when :return
29
- @raw = raw
30
- return parse_body
23
+ when :reject
24
+ raise Diplomat::AclAlreadyExists, id
25
+ when :return
26
+ @raw = raw
27
+ return parse_body
31
28
  end
32
- elsif raw.status == 200 and raw.body == "null"
29
+ elsif raw.status == 200 && raw.body == 'null'
33
30
  case not_found
34
- when :reject
35
- raise Diplomat::AclNotFound, @id
36
- when :return
37
- return nil
31
+ when :reject
32
+ raise Diplomat::AclNotFound, id
33
+ when :return
34
+ return nil
38
35
  end
39
36
  else
40
- raise Diplomat::UnknownStatus, "status #{raw.status}"
37
+ raise Diplomat::UnknownStatus, "status #{raw.status}: #{raw.body}"
41
38
  end
42
39
  end
40
+ # rubocop:enable PerceivedComplexity, MethodLength, CyclomaticComplexity, AbcSize
43
41
 
44
42
  # List all Acls
45
43
  # @return [List] list of [Hash] of Acls
46
44
  def list
47
- url = ["/v1/acl/list"]
45
+ url = ['/v1/acl/list']
48
46
  url += check_acl_token
49
47
  @raw = @conn_no_err.get concat_url url
50
- return parse_body
48
+ parse_body
51
49
  end
52
50
 
53
51
  # Update an Acl definition, create if not present
54
52
  # @param value [Hash] Acl definition, ID field is mandatory
55
53
  # @return [Hash] The result Acl
56
- def update value
54
+ def update(value)
57
55
  raise Diplomat::IdParameterRequired unless value['ID']
58
56
 
59
57
  @raw = @conn.put do |req|
60
- url = ["/v1/acl/update"]
58
+ url = ['/v1/acl/update']
61
59
  url += check_acl_token
62
60
  url += use_cas(@options)
63
61
  req.url concat_url url
64
62
  req.body = value.to_json
65
63
  end
66
- return parse_body
64
+ parse_body
67
65
  end
68
66
 
69
67
  # Create an Acl definition
70
68
  # @param value [Hash] Acl definition, ID field is mandatory
71
69
  # @return [Hash] The result Acl
72
- def create value
70
+ def create(value)
73
71
  @raw = @conn.put do |req|
74
- url = ["/v1/acl/create"]
72
+ url = ['/v1/acl/create']
75
73
  url += check_acl_token
76
74
  url += use_cas(@options)
77
75
  req.url concat_url url
78
76
  req.body = value.to_json
79
77
  end
80
- return parse_body
78
+ parse_body
81
79
  end
82
80
 
83
81
  # Destroy an ACl token by its id
84
82
  # @param ID [String] the Acl ID
85
83
  # @return [Bool]
86
- def destroy id
84
+ def destroy(id)
87
85
  @id = id
88
86
  url = ["/v1/acl/destroy/#{@id}"]
89
- url += check_acl_token
87
+ url << check_acl_token
90
88
  @raw = @conn.put concat_url url
91
- return @raw.body == "true"
89
+ @raw.body == 'true'
92
90
  end
93
91
  end
94
92
  end
@@ -1,15 +1,16 @@
1
1
  module Diplomat
2
+ # Helper methods for interacting with the Consul RESTful API
2
3
  module ApiOptions
3
4
  def check_acl_token
4
- use_named_parameter("token", Diplomat.configuration.acl_token)
5
+ use_named_parameter('token', Diplomat.configuration.acl_token)
5
6
  end
6
7
 
7
8
  def use_cas(options)
8
- if options then use_named_parameter("cas", options[:cas]) else [] end
9
+ options ? use_named_parameter('cas', options[:cas]) : []
9
10
  end
10
11
 
11
12
  def use_consistency(options)
12
- if options && options[:consistency] then ["#{options[:consistency]}"] else [] end
13
+ options && options[:consistency] ? [options[:consistency].to_s] : []
13
14
  end
14
15
  end
15
16
  end
@@ -1,17 +1,14 @@
1
- require 'base64'
2
- require 'faraday'
3
-
4
1
  module Diplomat
2
+ # Methods for interacting with the Consul check API endpoint
5
3
  class Check < Diplomat::RestClient
6
-
7
- @access_methods = [ :checks, :register_script, :register_ttl,
8
- :deregister, :pass, :warn, :fail ]
4
+ @access_methods = [:checks, :register_script, :register_ttl,
5
+ :deregister, :pass, :warn, :fail]
9
6
 
10
7
  # Get registered checks
11
8
  # @return [OpenStruct] all data associated with the service
12
9
  def checks
13
- ret = @conn.get "/v1/agent/checks"
14
- return JSON.parse(ret.body)
10
+ ret = @conn.get '/v1/agent/checks'
11
+ JSON.parse(ret.body)
15
12
  end
16
13
 
17
14
  # Register a check
@@ -22,23 +19,15 @@ module Diplomat
22
19
  # @param interval [String] frequency (with units) of the check execution
23
20
  # @param ttl [String] time (with units) to mark a check down
24
21
  # @return [Integer] Status code
25
- def register_script check_id, name, notes, script, interval
26
- json = JSON.generate(
27
- {
28
- "ID" => check_id,
29
- "Name" => name,
30
- "Notes" => notes,
31
- "Script" => script,
32
- "Interval" => interval
33
- }
34
- )
35
-
22
+ #
23
+ def register_script(check_id, name, notes, script, interval)
36
24
  ret = @conn.put do |req|
37
- req.url "/v1/agent/check/register"
38
- req.body = json
25
+ req.url '/v1/agent/check/register'
26
+ req.body = JSON.generate(
27
+ 'ID' => check_id, 'Name' => name, 'Notes' => notes, 'Script' => script, 'Interval' => interval
28
+ )
39
29
  end
40
-
41
- return ret.status == 200
30
+ ret.status == 200
42
31
  end
43
32
 
44
33
  # Register a TTL check
@@ -47,53 +36,46 @@ module Diplomat
47
36
  # @param notes [String] notes about the check
48
37
  # @param ttl [String] time (with units) to mark a check down
49
38
  # @return [Boolean] Success
50
- def register_ttl check_id, name, notes, ttl
51
- json = JSON.generate({
52
- "ID" => check_id,
53
- "Name" => name,
54
- "Notes" => notes,
55
- "TTL" => ttl,
56
- })
57
-
39
+ def register_ttl(check_id, name, notes, ttl)
58
40
  ret = @conn.put do |req|
59
- req.url "/v1/agent/check/register"
60
- req.body = json
41
+ req.url '/v1/agent/check/register'
42
+ req.body = JSON.generate(
43
+ 'ID' => check_id, 'Name' => name, 'Notes' => notes, 'TTL' => ttl
44
+ )
61
45
  end
62
-
63
- return ret.status == 200
46
+ ret.status == 200
64
47
  end
65
48
 
66
49
  # Deregister a check
67
50
  # @param check_id [String] the unique id of the check
68
51
  # @return [Integer] Status code
69
- def deregister check_id
52
+ def deregister(check_id)
70
53
  ret = @conn.get "/v1/agent/check/deregister/#{check_id}"
71
- return ret.status == 200
54
+ ret.status == 200
72
55
  end
73
56
 
74
57
  # Pass a check
75
58
  # @param check_id [String] the unique id of the check
76
59
  # @return [Integer] Status code
77
- def pass check_id
60
+ def pass(check_id)
78
61
  ret = @conn.get "/v1/agent/check/pass/#{check_id}"
79
- return ret.status == 200
62
+ ret.status == 200
80
63
  end
81
64
 
82
65
  # Warn a check
83
66
  # @param check_id [String] the unique id of the check
84
67
  # @return [Integer] Status code
85
- def warn check_id
68
+ def warn(check_id)
86
69
  ret = @conn.get "/v1/agent/check/warn/#{check_id}"
87
- return ret.status == 200
70
+ ret.status == 200
88
71
  end
89
72
 
90
73
  # Warn a check
91
74
  # @param check_id [String] the unique id of the check
92
75
  # @return [Integer] Status code
93
- def fail check_id
76
+ def fail(check_id)
94
77
  ret = @conn.get "/v1/agent/check/fail/#{check_id}"
95
- return ret.status == 200
78
+ ret.status == 200
96
79
  end
97
-
98
80
  end
99
81
  end
@@ -1,4 +1,5 @@
1
1
  module Diplomat
2
+ # Methods for configuring Diplomat
2
3
  class Configuration
3
4
  attr_accessor :middleware
4
5
  attr_accessor :url, :acl_token, :options
@@ -7,7 +8,7 @@ module Diplomat
7
8
  # @param url [String] consul's connection URL
8
9
  # @param acl_token [String] a connection token used when making requests to consul
9
10
  # @param options [Hash] extra options to configure Faraday::Connection
10
- def initialize(url="http://localhost:8500", acl_token=nil, options = {})
11
+ def initialize(url = 'http://localhost:8500', acl_token = nil, options = {})
11
12
  @middleware = []
12
13
  @url = url
13
14
  @acl_token = acl_token
@@ -20,7 +21,5 @@ module Diplomat
20
21
  return @middleware = middleware if middleware.is_a? Array
21
22
  @middleware = [middleware]
22
23
  end
23
-
24
24
  end
25
25
  end
26
-
@@ -1,27 +1,22 @@
1
- require 'base64'
2
- require 'faraday'
3
-
4
1
  module Diplomat
2
+ # Methods for interacting with the Consul dataceneter API endpoint
5
3
  class Datacenter < Diplomat::RestClient
6
-
7
- @access_methods = [ :get ]
4
+ @access_methods = [:get]
8
5
 
9
6
  # Get an array of all avaliable datacenters accessible by the local consul agent
10
7
  # @param meta [Hash] output structure containing header information about the request (index)
11
8
  # @return [OpenStruct] all datacenters avaliable to this consul agent
12
- def get meta=nil
13
-
14
- url = ["/v1/catalog/datacenters"]
9
+ def get(meta = nil)
10
+ url = ['/v1/catalog/datacenters']
15
11
 
16
12
  ret = @conn.get concat_url url
17
13
 
18
- if meta and ret.headers
19
- meta[:index] = ret.headers["x-consul-index"]
20
- meta[:knownleader] = ret.headers["x-consul-knownleader"]
21
- meta[:lastcontact] = ret.headers["x-consul-lastcontact"]
14
+ if meta && ret.headers
15
+ meta[:index] = ret.headers['x-consul-index']
16
+ meta[:knownleader] = ret.headers['x-consul-knownleader']
17
+ meta[:lastcontact] = ret.headers['x-consul-lastcontact']
22
18
  end
23
- return JSON.parse(ret.body)
19
+ JSON.parse(ret.body)
24
20
  end
25
-
26
21
  end
27
- end
22
+ end
@@ -6,6 +6,8 @@ module Diplomat
6
6
  class AclAlreadyExists < StandardError; end
7
7
  class EventNotFound < StandardError; end
8
8
  class EventAlreadyExists < StandardError; end
9
+ class QueryNotFound < StandardError; end
10
+ class QueryAlreadyExists < StandardError; end
9
11
  class UnknownStatus < StandardError; end
10
12
  class IdParameterRequired < StandardError; end
11
13
  end
@@ -1,11 +1,9 @@
1
- require 'faraday'
2
-
3
1
  module Diplomat
2
+ # Methods for interacting with the Consul event API endpoint
4
3
  class Event < Diplomat::RestClient
5
-
6
4
  include ApiOptions
7
-
8
- @access_methods = [ :fire, :get_all, :get ]
5
+
6
+ @access_methods = [:fire, :get_all, :get]
9
7
 
10
8
  # Send an event
11
9
  # @param name [String] the event name
@@ -14,15 +12,14 @@ module Diplomat
14
12
  # @param node [String] the target node name
15
13
  # @param tag [String] the target tag name, must only be used with service
16
14
  # @return [nil]
17
- def fire name, value=nil, service=nil, node=nil, tag=nil
18
- url = [ "/v1/event/fire/#{name}" ]
15
+ def fire(name, value = nil, service = nil, node = nil, tag = nil)
16
+ url = ["/v1/event/fire/#{name}"]
19
17
  url += check_acl_token
20
- url += use_named_parameter("service", service)
21
- url += use_named_parameter("node", node)
22
- url += use_named_parameter("tag", tag) if service
23
- url = concat_url url
18
+ url += use_named_parameter('service', service) if service
19
+ url += use_named_parameter('node', node) if node
20
+ url += use_named_parameter('tag', tag) if tag
24
21
 
25
- @conn.put(url, value)
22
+ @conn.put concat_url(url), value
26
23
  nil
27
24
  end
28
25
 
@@ -56,31 +53,32 @@ module Diplomat
56
53
  # - W R - get the first or current value; always return something, but
57
54
  # block only when necessary
58
55
  # - W W - get the first or next value; wait until there is an update
59
- def get_all name=nil, not_found=:reject, found=:return
60
- url = ["/v1/event/list"]
56
+ # rubocop:disable MethodLength, AbcSize
57
+ def get_all(name = nil, not_found = :reject, found = :return)
58
+ url = ['/v1/event/list']
61
59
  url += check_acl_token
62
- url += use_named_parameter("name", name)
60
+ url += use_named_parameter('name', name)
63
61
  url = concat_url url
64
62
 
65
63
  # Event list never returns 404 or blocks, but may return an empty list
66
64
  @raw = @conn.get url
67
- if JSON.parse(@raw.body).count == 0
65
+ if JSON.parse(@raw.body).count.zero?
68
66
  case not_found
69
- when :reject
70
- raise Diplomat::EventNotFound, name
71
- when :return
72
- return []
67
+ when :reject
68
+ raise Diplomat::EventNotFound, name
69
+ when :return
70
+ return []
73
71
  end
74
72
  else
75
73
  case found
76
- when :reject
77
- raise Diplomat::EventAlreadyExists, name
78
- when :return
79
- # Always set the response to 200 so we always return
80
- # the response body.
81
- @raw.status = 200
82
- @raw = parse_body
83
- return return_payload
74
+ when :reject
75
+ raise Diplomat::EventAlreadyExists, name
76
+ when :return
77
+ # Always set the response to 200 so we always return
78
+ # the response body.
79
+ @raw.status = 200
80
+ @raw = parse_body
81
+ return return_payload
84
82
  end
85
83
  end
86
84
 
@@ -88,6 +86,7 @@ module Diplomat
88
86
  @raw = parse_body
89
87
  return_payload
90
88
  end
89
+ # rubocop:enable MethodLength, AbcSize
91
90
 
92
91
  # Get a specific event in the sequence matching name
93
92
  # @param name [String] the name of the event (regex)
@@ -109,67 +108,66 @@ module Diplomat
109
108
  # middle, though these can only be identified relative to the preceding
110
109
  # event. However, this is ideal for iterating through the sequence of
111
110
  # events (while being sure that none are missed).
112
- def get name=nil, token=:last, not_found=:wait, found=:return
113
- url = ["/v1/event/list"]
111
+ # rubocop:disable MethodLength, CyclomaticComplexity, AbcSize
112
+ def get(name = nil, token = :last, not_found = :wait, found = :return)
113
+ url = ['/v1/event/list']
114
114
  url += check_acl_token
115
- url += use_named_parameter("name", name)
116
- url = concat_url url
117
- @raw = @conn.get url
115
+ url += use_named_parameter('name', name)
116
+ @raw = @conn.get concat_url url
118
117
  body = JSON.parse(@raw.body)
119
118
  # TODO: deal with unknown symbols, invalid indices (find_index will return nil)
120
119
  idx = case token
121
- when :first then 0
122
- when :last then body.length - 1
123
- when :next then body.length
124
- else body.find_index { |e| e["ID"] == token } + 1
120
+ when :first then 0
121
+ when :last then body.length - 1
122
+ when :next then body.length
123
+ else body.find_index { |e| e['ID'] == token } + 1
125
124
  end
126
- if idx == body.length then
125
+ if idx == body.length
127
126
  case not_found
128
- when :reject
129
- raise Diplomat::EventNotFound, name
130
- when :return
131
- event_name = ""
132
- event_payload = ""
133
- event_token = :last
134
- when :wait
135
- @raw = wait_for_next_event(url)
136
- @raw = parse_body
137
- # If it's possible for two events to arrive at once,
138
- # this needs to #find again:
139
- event = @raw.last
140
- event_name = event["Name"]
141
- event_payload = Base64.decode64(event["Payload"])
142
- event_token = event["ID"]
127
+ when :reject
128
+ raise Diplomat::EventNotFound, name
129
+ when :return
130
+ event_name = ''
131
+ event_payload = ''
132
+ event_token = :last
133
+ when :wait
134
+ @raw = wait_for_next_event(url)
135
+ @raw = parse_body
136
+ # If it's possible for two events to arrive at once,
137
+ # this needs to #find again:
138
+ event = @raw.last
139
+ event_name = event['Name']
140
+ event_payload = Base64.decode64(event['Payload'])
141
+ event_token = event['ID']
143
142
  end
144
143
  else
145
144
  case found
146
- when :reject
147
- raise Diplomat::EventAlreadyExits, name
148
- when :return
149
- event = body[idx]
150
- event_name = event["Name"]
151
- event_payload = Base64.decode64(event["Payload"])
152
- event_token = event["ID"]
145
+ when :reject
146
+ raise Diplomat::EventAlreadyExits, name
147
+ when :return
148
+ event = body[idx]
149
+ event_name = event['Name']
150
+ event_payload = Base64.decode64(event['Payload'])
151
+ event_token = event['ID']
153
152
  end
154
153
  end
155
154
 
156
155
  {
157
- :value => { :name => event_name, :payload => event_payload },
158
- :token => event_token
156
+ value: { name: event_name, payload: event_payload },
157
+ token: event_token
159
158
  }
160
159
  end
161
-
160
+ # rubocop:enable MethodLength, CyclomaticComplexity, AbcSize
162
161
 
163
162
  private
164
163
 
165
- def wait_for_next_event url
166
- index = @raw.headers["x-consul-index"]
167
- url = [url, use_named_parameter("index", index)].join("&")
168
- return @conn.get do |req|
164
+ def wait_for_next_event(url)
165
+ index = @raw.headers['x-consul-index']
166
+ url = [url, use_named_parameter('index', index)].join('&')
167
+ @conn.get do |req|
169
168
  req.url concat_url url
170
- req.options.timeout = 86400
169
+ req.options.timeout = 86_400
171
170
  end
172
171
  end
173
-
174
172
  end
175
173
  end