summaryrefslogtreecommitdiff
path: root/lib/oxidized/source
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-06-22 19:31:12 +0300
committerSaku Ytti <saku@ytti.fi>2018-06-22 19:31:12 +0300
commit04ffb2c68ac7f069bd9f33f39c77095c979aaec1 (patch)
treea2e99dd5d0806d10f88f0140b3ab98e6c265b5c6 /lib/oxidized/source
parent7a99cd83da26e21921311011fea63dacfd2999ae (diff)
rubycop fixes
Diffstat (limited to 'lib/oxidized/source')
-rw-r--r--lib/oxidized/source/csv.rb4
-rw-r--r--lib/oxidized/source/http.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/oxidized/source/csv.rb b/lib/oxidized/source/csv.rb
index 769b1f7..5b43352 100644
--- a/lib/oxidized/source/csv.rb
+++ b/lib/oxidized/source/csv.rb
@@ -20,7 +20,7 @@ module Oxidized
def load _node_want = nil
nodes = []
- get_file.each_line do |line|
+ open_file.each_line do |line|
next if line.match(/^\s*#/)
data = line.chomp.split(@cfg.delimiter, -1)
next if data.empty?
@@ -45,7 +45,7 @@ module Oxidized
private
- def get_file
+ def open_file
file = File.expand_path(@cfg.file)
if @cfg.gpg?
crypto = GPGME::Crypto.new password: @cfg.gpg_password
diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb
index 36fa764..26c9e05 100644
--- a/lib/oxidized/source/http.rb
+++ b/lib/oxidized/source/http.rb
@@ -17,7 +17,7 @@ module Oxidized
def load node_want = nil
nodes = []
- data = JSON.parse(get_http)
+ data = JSON.parse(read_http(node_want))
data = string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location?
data.each do |node|
next if node.empty?
@@ -52,7 +52,7 @@ module Oxidized
object
end
- def get_http
+ def read_http node_want
uri = URI.parse(@cfg.url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https'