]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/files/default/plugins/api_calls_
Fix more rubocop detected style issues
[chef.git] / cookbooks / munin / files / default / plugins / api_calls_
index 73e2615d0bf356a5f8a1f5617a589a6bc5801b61..cc2fd8a9da23b25422587e4460fe6359fbb7100f 100755 (executable)
@@ -52,15 +52,14 @@ if ARGV[0] == 'config'
   CALL_TYPES.each { |k, v| puts "#{k}.label #{v}" }
 
 else
   CALL_TYPES.each { |k, v| puts "#{k}.label #{v}" }
 
 else
-  counts = uris_from_status(server).
-      collect { |x| categorise_uri(x) }.
-      inject(Hash.new) do |h, e|
-    if h.has_key? e
+  counts = uris_from_status(server)
+           .collect { |x| categorise_uri(x) }
+           .each_with_object(Hash.new) do |h, e|
+    if h.key? e
       h[e] += 1
     else
       h[e] = 1
     end
       h[e] += 1
     else
       h[e] = 1
     end
-    h
   end
 
   CALL_TYPES.keys.each do |type|
   end
 
   CALL_TYPES.keys.each do |type|