]> git.openstreetmap.org Git - chef.git/commitdiff
Update rubocop and fix new warnings
authorTom Hughes <tom@compton.nu>
Fri, 6 Feb 2015 00:21:36 +0000 (00:21 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 6 Feb 2015 08:28:14 +0000 (08:28 +0000)
Gemfile.lock
cookbooks/munin/files/default/plugins/api_calls_
cookbooks/munin/files/default/plugins/api_calls_num
cookbooks/munin/files/default/plugins/api_waits_
cookbooks/networking/recipes/default.rb
cookbooks/planet/files/default/replication-bin/replicate-changesets

index 9f8087d565404c73f8a16760f30a827d37049893..84ec64fadfb435d08e56c6a1dd275522dc8b7831 100644 (file)
@@ -6,12 +6,12 @@ GEM
       parser (>= 2.2.0.pre.3, < 3.0)
     parser (2.2.0.2)
       ast (>= 1.1, < 3.0)
-    powerpack (0.0.9)
+    powerpack (0.1.0)
     rainbow (2.0.0)
-    rubocop (0.28.0)
+    rubocop (0.29.0)
       astrolabe (~> 1.3)
-      parser (>= 2.2.0.pre.7, < 3.0)
-      powerpack (~> 0.0.6)
+      parser (>= 2.2.0.1, < 3.0)
+      powerpack (~> 0.1)
       rainbow (>= 1.99.1, < 3.0)
       ruby-progressbar (~> 1.4)
     ruby-progressbar (1.7.1)
index 58797b8330ffa276cfed75f6b1e52b380aec3881..689f5120c26c7db1960fc7a11297e23a380f29e7 100755 (executable)
@@ -54,7 +54,7 @@ if ARGV[0] == 'config'
 else
   counts = uris_from_status(server)
            .collect { |x| categorise_uri(x) }
-           .each_with_object(Hash.new) do |h, e|
+           .each_with_object({}) do |h, e|
     if h.key? e
       h[e] += 1
     else
index b1d45422845e37eee924aa028819403d79baac3c..1c3a28e05536c1ceec46c453830e18983199bb0b 100755 (executable)
@@ -64,7 +64,7 @@ else
   delta_t = (max_time - min_time).to_f * 24 * 60
   counts = lines
            .collect { |x| categorise_uri(x) }
-           .each_with_object(Hash.new) do |h, e|
+           .each_with_object({}) do |h, e|
     if h.key? e
       h[e] += 1
     else
index 5eaa81a57c486530daf41d53f3236d794a779ff6..eb2a636863ec55551f3742fd4ac7c28cdcbf1e05 100755 (executable)
@@ -54,7 +54,7 @@ if ARGV[0] == 'config'
 else
   counts = uri_and_times_from_status(server)
            .collect { |x, y| [categorise_uri(x), y] }
-           .each_with_object(Hash.new) do |h, e|
+           .each_with_object({}) do |h, e|
     category, time = e
     if h.key? category
       h[category] += [time]
index 9eebca8c724b70fc89600cd8af305738d7df4234..50fa35cfb6bcafcfbdff420c939cabb7dfe257f4 100644 (file)
@@ -116,8 +116,8 @@ search(:node, "networking:interfaces").collect do |n|
   n.interfaces.each do |interface|
     next unless interface[:role] == "external" && interface[:zone]
 
-    zones[interface[:zone]] ||= Hash.new
-    zones[interface[:zone]][interface[:family]] ||= Array.new
+    zones[interface[:zone]] ||= {}
+    zones[interface[:zone]][interface[:family]] ||= []
     zones[interface[:zone]][interface[:family]] << interface[:address]
   end
 end
index b25f97aab6bd7c64420ed4b302141c8418dea9c8..87acbcccb0862b74a33b765df28672fd8c824e4f 100644 (file)
@@ -120,7 +120,7 @@ class Replicator
       fl.flock(File::LOCK_EX)
 
       sequence = (@state.key?('sequence') ? @state['sequence'] + 1 : 0)
-      data_file = @config['data_dir'] + sprintf("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000))
+      data_file = @config['data_dir'] + format("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000))
       tmp_state = @config['state_file'] + ".tmp"
       tmp_data = "/tmp/changeset_data.osm.tmp"
       # try and write the files to tmp locations and then