1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 09:57:09 +00:00

Ruby plugins: apply style changes as suggested by "rubocop --fix-layout"

This commit is contained in:
Lars Kruse 2020-08-25 16:52:39 +02:00
parent 26c29daa2b
commit b0b39b018e
30 changed files with 1447 additions and 1384 deletions

View file

@ -18,8 +18,8 @@ require 'open-uri'
def get_conf
# Default values
conf = {:host => '127.0.0.1', :port => 8000,
:username => 'admin', :password => 'hackme' }
conf = { :host => '127.0.0.1', :port => 8000,
:username => 'admin', :password => 'hackme' }
conf.keys.each do |key|
env_key = sprintf('icecast_%s', key)
conf[key] = ENV[env_key] if ENV.has_key?(env_key)
@ -31,8 +31,8 @@ def get_data(conf)
begin
data = Hpricot(open(sprintf('http://%s:%s/admin/stats',
conf[:host], conf[:port]),
:http_basic_authentication=>[conf[:username],
conf[:password]]))
:http_basic_authentication => [conf[:username],
conf[:password]]))
rescue OpenURI::HTTPError
puts "Cannot connect: HTTP connection error"
exit 1
@ -43,7 +43,7 @@ end
def get_values(data)
vals = {}
[:sources, :clients].each do |key|
elem = data/key
elem = data / key
if elem.nil?
vals[key] = 0
else