From: Tom Hughes Date: Sun, 5 Feb 2017 10:22:04 +0000 (+0000) Subject: Update rubocop X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5479793887e0b883ba46ad689390cf745297ece6?ds=sidebyside Update rubocop --- diff --git a/Gemfile b/Gemfile index 31e34a999..b70169870 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" -gem "rubocop" gem "foodcritic" -gem "test-kitchen" gem "kitchen-vagrant" +gem "rubocop" gem "serverspec" +gem "test-kitchen" diff --git a/Gemfile.lock b/Gemfile.lock index 94acd7592..54dd64532 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,11 +37,11 @@ GEM net-telnet (0.1.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) - parser (2.3.1.4) + parser (2.3.3.1) ast (~> 2.2) polyglot (0.3.5) powerpack (0.1.1) - rainbow (2.1.0) + rainbow (2.2.1) rake (11.3.0) rspec (3.5.0) rspec-core (~> 3.5.0) @@ -59,8 +59,8 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) - rubocop (0.45.0) - parser (>= 2.3.1.1, < 3.0) + rubocop (0.47.1) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) @@ -90,7 +90,7 @@ GEM thor (0.19.1) treetop (1.6.8) polyglot (~> 0.3) - unicode-display_width (1.1.1) + unicode-display_width (1.1.3) yajl-ruby (1.3.0) PLATFORMS diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index d0f51a0a6..2bebd0c75 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -77,7 +77,7 @@ action :create do end layers = Dir.glob("/srv/imagery/layers/#{name}/*.yml").collect do |path| - YAML.load(::File.read(path)) + YAML.safe_load(::File.read(path)) end template "/srv/#{name}/imagery.js" do diff --git a/cookbooks/kibana/recipes/default.rb b/cookbooks/kibana/recipes/default.rb index e4dd05c9f..160d3233c 100644 --- a/cookbooks/kibana/recipes/default.rb +++ b/cookbooks/kibana/recipes/default.rb @@ -73,7 +73,7 @@ end node[:kibana][:sites].each do |name, details| file "/etc/kibana/#{name}.yml" do - content YAML.dump(YAML.load(File.read("/opt/kibana-#{version}/config/kibana.yml")).merge( + content YAML.dump(YAML.safe_load(File.read("/opt/kibana-#{version}/config/kibana.yml")).merge( "port" => details[:port], "host" => "127.0.0.1", "elasticsearch_url" => details[:elasticsearch_url], diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index 9e1615147..8c943902a 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -141,8 +141,8 @@ end # replicated to a file. class Replicator def initialize(config) - @config = YAML.load(File.read(config)) - @state = YAML.load(File.read(@config["state_file"])) + @config = YAML.safe_load(File.read(config)) + @state = YAML.safe_load(File.read(@config["state_file"])) @conn = PGconn.connect(@config["db"]) # get current time from the database rather than the current system @now = @conn.exec("select now() as now").map { |row| Time.parse(row["now"]) }[0]