Skip to content

Commit 36c810c

Browse files
committed
rubocop
1 parent d6c3757 commit 36c810c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

lib/influxdb/client/http.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
module InfluxDB
77
# rubocop:disable Metrics/MethodLength
8+
# rubocop:disable Metrics/ModuleLength
89
# rubocop:disable Metrics/AbcSize
910
module HTTP # :nodoc:
1011
def get(url, options = {})
@@ -43,7 +44,7 @@ def connect_with_retry
4344
delay = config.initial_delay
4445
retry_count = 0
4546

46-
http = get_http
47+
http = current_http
4748

4849
begin
4950
http.start unless http.started?
@@ -135,14 +136,14 @@ def generate_cert_store
135136
store
136137
end
137138

138-
def get_http
139+
def current_http
139140
return build_http config.next_host unless config.persistent
140141

141142
@https ||=
142143
begin
143-
https = config.hosts.map { |host|
144+
https = config.hosts.map do |host|
144145
build_http host
145-
}
146+
end
146147

147148
Hash[config.hosts.zip(https)]
148149
end

lib/influxdb/config.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
require "uri"
22

3+
# :rubocop:disable Metrics/ClassLength
4+
35
module InfluxDB
46
# DEFAULT_CONFIG_OPTIONS maps (most) of the configuration options to
57
# their default value. Each option (except for "async" and "udp") can

spec/influxdb/client_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@
6060
end
6161
end
6262

63-
describe "#get_http" do
63+
describe "#current_http" do
6464
it "returns an existing connection with persistence enabled" do
65-
first = subject.send :get_http
66-
second = subject.send :get_http
65+
first = subject.send :current_http
66+
second = subject.send :current_http
6767

6868
expect(first).to equal(second)
6969
end
7070

7171
it "returns a new connection with persistence disabled" do
7272
subject.config.persistent = false
7373

74-
first = subject.send :get_http
75-
second = subject.send :get_http
74+
first = subject.send :current_http
75+
second = subject.send :current_http
7676

7777
expect(first).to_not equal(second)
7878
end

0 commit comments

Comments
 (0)