From: Tom Hughes Date: Fri, 20 Feb 2015 19:14:23 +0000 (+0000) Subject: Standardise on double quoted strings X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/6f0a393ef9191a70d9c5040ed35f6ee4ca33db8b?hp=2f5c06d08c5a2fcc42d57896ba7151bee326f7ac Standardise on double quoted strings --- diff --git a/.rubocop.yml b/.rubocop.yml index f11a7d911..f9eb73942 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,3 +7,6 @@ Style/AlignParameters: Style/SingleSpaceBeforeFirstArg: Exclude: - '**/metadata.rb' + +Style/StringLiterals: + EnforcedStyle: double_quotes diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 07185ec2c..eab32f0dd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -61,9 +61,3 @@ Style/MultilineOperationIndentation: # Cop supports --auto-correct. Style/NumericLiterals: MinDigits: 11 - -# Offense count: 6548 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/StringLiterals: - Enabled: false diff --git a/Gemfile b/Gemfile index d1ca20509..47ac10107 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -gem 'rubocop' -gem 'foodcritic' +gem "rubocop" +gem "foodcritic" diff --git a/cookbooks/accounts/metadata.rb b/cookbooks/accounts/metadata.rb index 5ee363947..f85cff465 100644 --- a/cookbooks/accounts/metadata.rb +++ b/cookbooks/accounts/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Accounts management" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" attribute "accounts", diff --git a/cookbooks/apache/metadata.rb b/cookbooks/apache/metadata.rb index 6da0ce647..24c69d703 100644 --- a/cookbooks/apache/metadata.rb +++ b/cookbooks/apache/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures apache" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "ssl" diff --git a/cookbooks/apt/metadata.rb b/cookbooks/apt/metadata.rb index 51281db29..ee74103b9 100644 --- a/cookbooks/apt/metadata.rb +++ b/cookbooks/apt/metadata.rb @@ -3,7 +3,7 @@ maintainer "Tom Hughes" maintainer_email "tom@compton.nu" license "Apache 2.0" description "Installs/Configures apt" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "0.1" supports "debian" supports "ubuntu" diff --git a/cookbooks/backup/metadata.rb b/cookbooks/backup/metadata.rb index bba2572c2..ed57e3616 100644 --- a/cookbooks/backup/metadata.rb +++ b/cookbooks/backup/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures backup.openstreetmap.org" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/bind/metadata.rb b/cookbooks/bind/metadata.rb index 67a7e44bc..3488028c2 100644 --- a/cookbooks/bind/metadata.rb +++ b/cookbooks/bind/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures bind" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" diff --git a/cookbooks/blog/metadata.rb b/cookbooks/blog/metadata.rb index 64060a9c1..0ac7d0903 100644 --- a/cookbooks/blog/metadata.rb +++ b/cookbooks/blog/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures Blog services" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "wordpress" diff --git a/cookbooks/cgiirc/metadata.rb b/cookbooks/cgiirc/metadata.rb index 7f1bd145d..444522c49 100644 --- a/cookbooks/cgiirc/metadata.rb +++ b/cookbooks/cgiirc/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures cgiirc" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/chef/files/default/knife.rb b/cookbooks/chef/files/default/knife.rb index a65cba956..c6b83f06a 100644 --- a/cookbooks/chef/files/default/knife.rb +++ b/cookbooks/chef/files/default/knife.rb @@ -1,11 +1,11 @@ -node_name 'chef-git' -client_key 'client.pem' -validation_client_name 'chef-validator' -validation_key '/etc/chef/validation.pem' -chef_server_url 'https://chef.openstreetmap.org' -cache_type 'BasicFile' -cache_options :path => '.chef/checksums' -cookbook_path ['cookbooks'] -cookbook_copyright 'OpenStreetMap Administrators' -cookbook_email 'admins@openstreetmap.org' -cookbook_license 'apachev2' +node_name "chef-git" +client_key "client.pem" +validation_client_name "chef-validator" +validation_key "/etc/chef/validation.pem" +chef_server_url "https://chef.openstreetmap.org" +cache_type "BasicFile" +cache_options :path => ".chef/checksums" +cookbook_path ["cookbooks"] +cookbook_copyright "OpenStreetMap Administrators" +cookbook_email "admins@openstreetmap.org" +cookbook_license "apachev2" diff --git a/cookbooks/chef/libraries/remote_directory.rb b/cookbooks/chef/libraries/remote_directory.rb index 730535d44..959eb2940 100644 --- a/cookbooks/chef/libraries/remote_directory.rb +++ b/cookbooks/chef/libraries/remote_directory.rb @@ -15,7 +15,7 @@ class Chef return unless @new_resource.purge files_to_purge = Set.new( - Dir.glob(::File.join(@new_resource.path, '**', '*'), ::File::FNM_DOTMATCH).select do |name| + Dir.glob(::File.join(@new_resource.path, "**", "*"), ::File::FNM_DOTMATCH).select do |name| name !~ /(?:^|#{Regexp.escape(::File::SEPARATOR)})\.\.?$/ end ) diff --git a/cookbooks/chef/libraries/subversion.rb b/cookbooks/chef/libraries/subversion.rb index 25485f4bb..86597458a 100644 --- a/cookbooks/chef/libraries/subversion.rb +++ b/cookbooks/chef/libraries/subversion.rb @@ -13,7 +13,7 @@ class Chef end def current_repository - @current_repository ||= repo_attrs['URL'] + @current_repository ||= repo_attrs["URL"] end def current_repository_matches_target_repository? diff --git a/cookbooks/chef/metadata.rb b/cookbooks/chef/metadata.rb index 83bb6013c..08f2c330e 100644 --- a/cookbooks/chef/metadata.rb +++ b/cookbooks/chef/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures chef" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "apt" diff --git a/cookbooks/civicrm/metadata.rb b/cookbooks/civicrm/metadata.rb index ad57baf1e..9b47426d0 100644 --- a/cookbooks/civicrm/metadata.rb +++ b/cookbooks/civicrm/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures CiviCRM" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "wordpress" depends "mysql" diff --git a/cookbooks/clamav/metadata.rb b/cookbooks/clamav/metadata.rb index 847d10bd9..c144002b0 100644 --- a/cookbooks/clamav/metadata.rb +++ b/cookbooks/clamav/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures clamav" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/db/metadata.rb b/cookbooks/db/metadata.rb index 1dd2e9c80..a93bc9034 100644 --- a/cookbooks/db/metadata.rb +++ b/cookbooks/db/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures database servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "postgresql" depends "web" diff --git a/cookbooks/dev/metadata.rb b/cookbooks/dev/metadata.rb index 6362520c6..361e9f628 100644 --- a/cookbooks/dev/metadata.rb +++ b/cookbooks/dev/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures dev services" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "passenger" diff --git a/cookbooks/devices/metadata.rb b/cookbooks/devices/metadata.rb index ba8f31125..8c7571484 100644 --- a/cookbooks/devices/metadata.rb +++ b/cookbooks/devices/metadata.rb @@ -3,7 +3,7 @@ maintainer "Tom Hughes" maintainer_email "tom@compton.nu" license "Apache 2.0" description "Configures devices" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "0.1" attribute "devices", diff --git a/cookbooks/dhcpd/metadata.rb b/cookbooks/dhcpd/metadata.rb index 369d9fca7..7f661d662 100644 --- a/cookbooks/dhcpd/metadata.rb +++ b/cookbooks/dhcpd/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures dhcpd" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" diff --git a/cookbooks/dns/metadata.rb b/cookbooks/dns/metadata.rb index 96d9153b7..6a0eef09a 100644 --- a/cookbooks/dns/metadata.rb +++ b/cookbooks/dns/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configure DNS management" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "git" depends "apache" diff --git a/cookbooks/elasticsearch/metadata.rb b/cookbooks/elasticsearch/metadata.rb index 330273c7a..bf14fba3a 100644 --- a/cookbooks/elasticsearch/metadata.rb +++ b/cookbooks/elasticsearch/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a elasticsearch server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/exim/metadata.rb b/cookbooks/exim/metadata.rb index df68d4568..ed1d59da5 100644 --- a/cookbooks/exim/metadata.rb +++ b/cookbooks/exim/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures exim" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" diff --git a/cookbooks/fail2ban/metadata.rb b/cookbooks/fail2ban/metadata.rb index 3f4b45f7f..8f62b08cd 100644 --- a/cookbooks/fail2ban/metadata.rb +++ b/cookbooks/fail2ban/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures fail2ban" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/forum/metadata.rb b/cookbooks/forum/metadata.rb index 797c0cb8c..ea3407d02 100644 --- a/cookbooks/forum/metadata.rb +++ b/cookbooks/forum/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a roundup server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "git" diff --git a/cookbooks/foundation/metadata.rb b/cookbooks/foundation/metadata.rb index fb40d15f4..f048278be 100644 --- a/cookbooks/foundation/metadata.rb +++ b/cookbooks/foundation/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures foundation services" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "mediawiki" diff --git a/cookbooks/geodns/metadata.rb b/cookbooks/geodns/metadata.rb index 3f658ed3d..9dd9a0a37 100644 --- a/cookbooks/geodns/metadata.rb +++ b/cookbooks/geodns/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a geographic DNS server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/git/metadata.rb b/cookbooks/git/metadata.rb index c9e524581..fa82a439c 100644 --- a/cookbooks/git/metadata.rb +++ b/cookbooks/git/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures git" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" depends "xinetd" diff --git a/cookbooks/gps-tile/metadata.rb b/cookbooks/gps-tile/metadata.rb index 2d944c06e..4ce457d42 100644 --- a/cookbooks/gps-tile/metadata.rb +++ b/cookbooks/gps-tile/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures a GPS tile server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/hardware/metadata.rb b/cookbooks/hardware/metadata.rb index 635d7b036..aa292111b 100644 --- a/cookbooks/hardware/metadata.rb +++ b/cookbooks/hardware/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures hardware" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "git" diff --git a/cookbooks/incron/metadata.rb b/cookbooks/incron/metadata.rb index 3e21a533e..42d6738a6 100644 --- a/cookbooks/incron/metadata.rb +++ b/cookbooks/incron/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures incron" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/mailman/metadata.rb b/cookbooks/mailman/metadata.rb index d2f15f54a..0ba3d6a21 100644 --- a/cookbooks/mailman/metadata.rb +++ b/cookbooks/mailman/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures mailman" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/mediawiki/definitions/mediawiki_site.rb b/cookbooks/mediawiki/definitions/mediawiki_site.rb index 017d77b30..8b0ddaccb 100644 --- a/cookbooks/mediawiki/definitions/mediawiki_site.rb +++ b/cookbooks/mediawiki/definitions/mediawiki_site.rb @@ -95,7 +95,7 @@ define :mediawiki_site, :action => [:create, :enable] do not_if do File.exist?("#{mediawiki[:directory]}/LocalSettings-install.php") end - notifies :create, 'ruby_block[rename-installer-localsettings]', :immediately + notifies :create, "ruby_block[rename-installer-localsettings]", :immediately end execute "#{mediawiki[:directory]}/maintenance/update.php" do diff --git a/cookbooks/mediawiki/metadata.rb b/cookbooks/mediawiki/metadata.rb index 602db82c9..46daf9a65 100644 --- a/cookbooks/mediawiki/metadata.rb +++ b/cookbooks/mediawiki/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures mediawiki" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "memcached" depends "apache" diff --git a/cookbooks/memcached/metadata.rb b/cookbooks/memcached/metadata.rb index 374c15f74..7abd699a4 100644 --- a/cookbooks/memcached/metadata.rb +++ b/cookbooks/memcached/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures memcached" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/munin/files/default/plugins/api_calls_ b/cookbooks/munin/files/default/plugins/api_calls_ index 689f5120c..8b4dd770d 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_ +++ b/cookbooks/munin/files/default/plugins/api_calls_ @@ -1,16 +1,16 @@ #!/usr/bin/ruby -require 'rubygems' -require 'date' -require 'hpricot' -require 'open-uri' +require "rubygems" +require "date" +require "hpricot" +require "open-uri" def uris_from_status(server) file = open("http://#{server}/server-status").read doc = Hpricot.parse(file) - tables = doc / 'table' - rows = (tables[0] / 'tr')[1..-1] - data = rows.collect { |r| (r / 'td').collect(&:inner_html) } + tables = doc / "table" + rows = (tables[0] / "tr")[1..-1] + data = rows.collect { |r| (r / "td").collect(&:inner_html) } # filter where the PID is numeric, status is 'W' and host matches the server matching_data = data.select { |r| (r[1].to_i > 0) && r[3].match(/W/) && r[11].match(server) } # return only the URI part @@ -45,7 +45,7 @@ end server = $PROGRAM_NAME.match("api_calls_(.*)")[1] -if ARGV[0] == 'config' +if ARGV[0] == "config" puts "graph_title Active requests" puts "graph_vlabel Number of requests" puts "graph_category api" diff --git a/cookbooks/munin/files/default/plugins/api_calls_num b/cookbooks/munin/files/default/plugins/api_calls_num index 1c3a28e05..fbc64f387 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_num +++ b/cookbooks/munin/files/default/plugins/api_calls_num @@ -1,9 +1,9 @@ #!/usr/bin/ruby -require 'rubygems' -require 'date' -gem 'home_run', '>= 0' -require 'apache_log_regex' +require "rubygems" +require "date" +gem "home_run", ">= 0" +require "apache_log_regex" NUM_LINES = 10000 @@ -53,7 +53,7 @@ def categorise_uri(line) end end -if ARGV[0] == 'config' +if ARGV[0] == "config" puts "graph_title Requests processed" puts "graph_vlabel Number of requests per minute" puts "graph_category api" diff --git a/cookbooks/munin/files/default/plugins/api_waits_ b/cookbooks/munin/files/default/plugins/api_waits_ index eb2a63686..e4a991a4c 100755 --- a/cookbooks/munin/files/default/plugins/api_waits_ +++ b/cookbooks/munin/files/default/plugins/api_waits_ @@ -1,16 +1,16 @@ #!/usr/bin/ruby -require 'rubygems' -require 'date' -require 'hpricot' -require 'open-uri' +require "rubygems" +require "date" +require "hpricot" +require "open-uri" def uri_and_times_from_status(server) file = open("http://#{server}/server-status").read doc = Hpricot.parse(file) - tables = doc / 'table' - rows = (tables[0] / 'tr')[1..-1] - data = rows.collect { |r| (r / 'td').collect(&:inner_html) } + tables = doc / "table" + rows = (tables[0] / "tr")[1..-1] + data = rows.collect { |r| (r / "td").collect(&:inner_html) } # filter where the PID is numeric, status is 'W' and host matches the server matching_data = data.select { |r| (r[1].to_i > 0) && r[3].match(/W/) && r[11].match(server) } # return URI and number of seconds processing for each request @@ -45,7 +45,7 @@ end server = $PROGRAM_NAME.match("api_waits_(.*)")[1] -if ARGV[0] == 'config' +if ARGV[0] == "config" puts "graph_title Wait times for active requests" puts "graph_vlabel Average time of requests" puts "graph_category api" diff --git a/cookbooks/munin/metadata.rb b/cookbooks/munin/metadata.rb index 1c5429383..b45c7575c 100644 --- a/cookbooks/munin/metadata.rb +++ b/cookbooks/munin/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures munin" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "networking" diff --git a/cookbooks/mysql/metadata.rb b/cookbooks/mysql/metadata.rb index 81d54e013..547f5e452 100644 --- a/cookbooks/mysql/metadata.rb +++ b/cookbooks/mysql/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures mysql" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" attribute "mysql", diff --git a/cookbooks/networking/metadata.rb b/cookbooks/networking/metadata.rb index e74507192..bbe92adce 100644 --- a/cookbooks/networking/metadata.rb +++ b/cookbooks/networking/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures networking" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" recipe "networking", "Configures networking via attributes" supports "ubuntu" diff --git a/cookbooks/nfs/metadata.rb b/cookbooks/nfs/metadata.rb index 4e2ae4966..b2038e832 100644 --- a/cookbooks/nfs/metadata.rb +++ b/cookbooks/nfs/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures nfs" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/nginx/metadata.rb b/cookbooks/nginx/metadata.rb index 17a364c91..2710e6c54 100644 --- a/cookbooks/nginx/metadata.rb +++ b/cookbooks/nginx/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures nginx" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "ssl" diff --git a/cookbooks/nodejs/metadata.rb b/cookbooks/nodejs/metadata.rb index a146f6347..702c77c3b 100644 --- a/cookbooks/nodejs/metadata.rb +++ b/cookbooks/nodejs/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures Node.js" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/nominatim/metadata.rb b/cookbooks/nominatim/metadata.rb index 6914af1c8..c587054c0 100644 --- a/cookbooks/nominatim/metadata.rb +++ b/cookbooks/nominatim/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures nominatim servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "postgresql" diff --git a/cookbooks/ntp/metadata.rb b/cookbooks/ntp/metadata.rb index adcfc75ca..d1906c34c 100644 --- a/cookbooks/ntp/metadata.rb +++ b/cookbooks/ntp/metadata.rb @@ -3,7 +3,7 @@ maintainer "Opscode, Inc." maintainer_email "cookbooks@opscode.com" license "Apache 2.0" description "Installs and configures ntp as a client or server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "0.8.2" recipe "ntp", "Installs and configures ntp either as a server or client" diff --git a/cookbooks/ohai/metadata.rb b/cookbooks/ohai/metadata.rb index 9706391fe..426a1ad5c 100644 --- a/cookbooks/ohai/metadata.rb +++ b/cookbooks/ohai/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures ohai" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/openvpn/metadata.rb b/cookbooks/openvpn/metadata.rb index 7580e30cf..7478cdec4 100644 --- a/cookbooks/openvpn/metadata.rb +++ b/cookbooks/openvpn/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures OpenVPN" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/osmosis/metadata.rb b/cookbooks/osmosis/metadata.rb index 3a78801f4..b5c22ec53 100644 --- a/cookbooks/osmosis/metadata.rb +++ b/cookbooks/osmosis/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures osmosis" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "chef" diff --git a/cookbooks/osqa/metadata.rb b/cookbooks/osqa/metadata.rb index 5239f2e69..eb9898710 100644 --- a/cookbooks/osqa/metadata.rb +++ b/cookbooks/osqa/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures OSQA" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "memcached" diff --git a/cookbooks/otrs/metadata.rb b/cookbooks/otrs/metadata.rb index 4bc7d721d..bb738af76 100644 --- a/cookbooks/otrs/metadata.rb +++ b/cookbooks/otrs/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures OTRS" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "postgresql" diff --git a/cookbooks/owl/metadata.rb b/cookbooks/owl/metadata.rb index ba455cfda..86976a6f9 100644 --- a/cookbooks/owl/metadata.rb +++ b/cookbooks/owl/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures OWL servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "postgresql" diff --git a/cookbooks/passenger/metadata.rb b/cookbooks/passenger/metadata.rb index bad97ca8b..937c95fe9 100644 --- a/cookbooks/passenger/metadata.rb +++ b/cookbooks/passenger/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures passenger" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "munin" diff --git a/cookbooks/piwik/metadata.rb b/cookbooks/piwik/metadata.rb index ab859e6d1..fd4f28965 100644 --- a/cookbooks/piwik/metadata.rb +++ b/cookbooks/piwik/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures Piwik" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "mysql" diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index 87acbcccb..59233847b 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -1,12 +1,12 @@ #!/usr/bin/ruby -require 'rubygems' -require 'pg' -require 'yaml' -require 'time' -require 'fileutils' -require 'xml/libxml' -require 'zlib' +require "rubygems" +require "pg" +require "yaml" +require "time" +require "fileutils" +require "xml/libxml" +require "zlib" # after this many changes, a changeset will be closed CHANGES_LIMIT = 50000 @@ -22,10 +22,10 @@ class Changeset attr_reader :id, :created_at, :closed_at, :num_changes def initialize(row) - @id = row['id'].to_i - @created_at = Time.parse(row['created_at']) - @closed_at = Time.parse(row['closed_at']) - @num_changes = row['num_changes'].to_i + @id = row["id"].to_i + @created_at = Time.parse(row["created_at"]) + @closed_at = Time.parse(row["closed_at"]) + @num_changes = row["num_changes"].to_i end def closed?(t) @@ -47,15 +47,15 @@ end class Replicator def initialize(config) @config = YAML.load(File.read(config)) - @state = YAML.load(File.read(@config['state_file'])) - @conn = PGconn.connect(@config['db']) + @state = YAML.load(File.read(@config["state_file"])) + @conn = PGconn.connect(@config["db"]) @now = Time.now.getutc end def open_changesets - last_run = @state['last_run'] + last_run = @state["last_run"] last_run = (@now - 60) if last_run.nil? - @state['last_run'] = @now + @state["last_run"] = @now # pretty much all operations on a changeset will modify its closed_at # time (see rails_port's changeset model). so it is probably enough # for us to look at anything that was closed recently, and filter from @@ -71,40 +71,40 @@ class Replicator def changeset_dump(changesets) doc = XML::Document.new doc.root = XML::Node.new("osm") - { 'version' => '0.6', - 'generator' => 'replicate_changesets.rb', - 'copyright' => "OpenStreetMap and contributors", - 'attribution' => "http://www.openstreetmap.org/copyright", - 'license' => "http://opendatacommons.org/licenses/odbl/1-0/" } + { "version" => "0.6", + "generator" => "replicate_changesets.rb", + "copyright" => "OpenStreetMap and contributors", + "attribution" => "http://www.openstreetmap.org/copyright", + "license" => "http://opendatacommons.org/licenses/odbl/1-0/" } .each { |k, v| doc.root[k] = v } changesets.each do |cs| xml = XML::Node.new("changeset") - xml['id'] = cs.id.to_s - xml['created_at'] = cs.created_at.getutc.xmlschema - xml['closed_at'] = cs.closed_at.getutc.xmlschema if cs.closed?(@now) - xml['open'] = cs.open?(@now).to_s - xml['num_changes'] = cs.num_changes.to_s + xml["id"] = cs.id.to_s + xml["created_at"] = cs.created_at.getutc.xmlschema + xml["closed_at"] = cs.closed_at.getutc.xmlschema if cs.closed?(@now) + xml["open"] = cs.open?(@now).to_s + xml["num_changes"] = cs.num_changes.to_s res = @conn.exec("select u.id, u.display_name, c.min_lat, c.max_lat, c.min_lon, c.max_lon from users u join changesets c on u.id=c.user_id where c.id=#{cs.id}") - xml['user'] = res[0]['display_name'] - xml['uid'] = res[0]['id'] - - unless res[0]['min_lat'].nil? || - res[0]['max_lat'].nil? || - res[0]['min_lon'].nil? || - res[0]['max_lon'].nil? - xml['min_lat'] = (res[0]['min_lat'].to_f / GEO_SCALE).to_s - xml['max_lat'] = (res[0]['max_lat'].to_f / GEO_SCALE).to_s - xml['min_lon'] = (res[0]['min_lon'].to_f / GEO_SCALE).to_s - xml['max_lon'] = (res[0]['max_lon'].to_f / GEO_SCALE).to_s + xml["user"] = res[0]["display_name"] + xml["uid"] = res[0]["id"] + + unless res[0]["min_lat"].nil? || + res[0]["max_lat"].nil? || + res[0]["min_lon"].nil? || + res[0]["max_lon"].nil? + xml["min_lat"] = (res[0]["min_lat"].to_f / GEO_SCALE).to_s + xml["max_lat"] = (res[0]["max_lat"].to_f / GEO_SCALE).to_s + xml["min_lon"] = (res[0]["min_lon"].to_f / GEO_SCALE).to_s + xml["max_lon"] = (res[0]["max_lon"].to_f / GEO_SCALE).to_s end res = @conn.exec("select k, v from changeset_tags where changeset_id=#{cs.id}") res.each do |row| tag = XML::Node.new("tag") - tag['k'] = row['k'] - tag['v'] = row['v'] + tag["k"] = row["k"] + tag["v"] = row["v"] xml << tag end @@ -116,12 +116,12 @@ class Replicator # saves new state (including the changeset dump xml) def save! - File.open(@config['state_file'], "r") do |fl| + File.open(@config["state_file"], "r") do |fl| fl.flock(File::LOCK_EX) - sequence = (@state.key?('sequence') ? @state['sequence'] + 1 : 0) - data_file = @config['data_dir'] + format("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000)) - tmp_state = @config['state_file'] + ".tmp" + sequence = (@state.key?("sequence") ? @state["sequence"] + 1 : 0) + 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 # move them into place later, to avoid in-progress @@ -131,12 +131,12 @@ class Replicator Zlib::GzipWriter.open(tmp_data) do |fh| fh.write(changeset_dump(open_changesets)) end - @state['sequence'] = sequence + @state["sequence"] = sequence File.open(tmp_state, "w") do |fh| fh.write(YAML.dump(@state)) end FileUtils.mv(tmp_data, data_file) - FileUtils.mv(tmp_state, @config['state_file']) + FileUtils.mv(tmp_state, @config["state_file"]) fl.flock(File::LOCK_UN) rescue diff --git a/cookbooks/planet/metadata.rb b/cookbooks/planet/metadata.rb index c84c69023..d26c7ff8c 100644 --- a/cookbooks/planet/metadata.rb +++ b/cookbooks/planet/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a planet server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "git" diff --git a/cookbooks/postgresql/libraries/postgresql.rb b/cookbooks/postgresql/libraries/postgresql.rb index 0b405e89b..f80efe15a 100644 --- a/cookbooks/postgresql/libraries/postgresql.rb +++ b/cookbooks/postgresql/libraries/postgresql.rb @@ -1,4 +1,4 @@ -require 'chef/mixin/command' +require "chef/mixin/command" class Chef class PostgreSQL diff --git a/cookbooks/postgresql/metadata.rb b/cookbooks/postgresql/metadata.rb index 87074a93b..07dbc4d45 100644 --- a/cookbooks/postgresql/metadata.rb +++ b/cookbooks/postgresql/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures postgresql" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "ohai" diff --git a/cookbooks/roundup/metadata.rb b/cookbooks/roundup/metadata.rb index 2058133d7..8b1be50f1 100644 --- a/cookbooks/roundup/metadata.rb +++ b/cookbooks/roundup/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a roundup server" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/rsyncd/metadata.rb b/cookbooks/rsyncd/metadata.rb index 9b412fe2c..0aeda0cf1 100644 --- a/cookbooks/rsyncd/metadata.rb +++ b/cookbooks/rsyncd/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures rsyncd" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" diff --git a/cookbooks/snmpd/metadata.rb b/cookbooks/snmpd/metadata.rb index b2cbf92be..58dfbb217 100644 --- a/cookbooks/snmpd/metadata.rb +++ b/cookbooks/snmpd/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures snmpd" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "networking" diff --git a/cookbooks/spamassassin/metadata.rb b/cookbooks/spamassassin/metadata.rb index 67a81e0ab..19f335ba8 100644 --- a/cookbooks/spamassassin/metadata.rb +++ b/cookbooks/spamassassin/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures spamassassin" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/squid/metadata.rb b/cookbooks/squid/metadata.rb index 4a2c79a4a..87a766776 100644 --- a/cookbooks/squid/metadata.rb +++ b/cookbooks/squid/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures squid" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/ssl/metadata.rb b/cookbooks/ssl/metadata.rb index ad136317d..89f6df9d2 100644 --- a/cookbooks/ssl/metadata.rb +++ b/cookbooks/ssl/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures basic SSL support" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/stateofthemap/metadata.rb b/cookbooks/stateofthemap/metadata.rb index 2e6141006..fcc8589a2 100644 --- a/cookbooks/stateofthemap/metadata.rb +++ b/cookbooks/stateofthemap/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures State of the Map services" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "wordpress" diff --git a/cookbooks/stats/metadata.rb b/cookbooks/stats/metadata.rb index 80dd31d7e..9ef4ba688 100644 --- a/cookbooks/stats/metadata.rb +++ b/cookbooks/stats/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures stats.openstreetmap.org" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/subversion/metadata.rb b/cookbooks/subversion/metadata.rb index af8bec922..8886f6b93 100644 --- a/cookbooks/subversion/metadata.rb +++ b/cookbooks/subversion/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures subversion servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/supybot/metadata.rb b/cookbooks/supybot/metadata.rb index 6af497867..ee6d1c463 100644 --- a/cookbooks/supybot/metadata.rb +++ b/cookbooks/supybot/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures supybot" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/switch2osm/metadata.rb b/cookbooks/switch2osm/metadata.rb index 32cbcb653..e5a82aba0 100644 --- a/cookbooks/switch2osm/metadata.rb +++ b/cookbooks/switch2osm/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures servers for switch2osm" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "wordpress" diff --git a/cookbooks/sysctl/metadata.rb b/cookbooks/sysctl/metadata.rb index 6d0db3229..8d12ccdc9 100644 --- a/cookbooks/sysctl/metadata.rb +++ b/cookbooks/sysctl/metadata.rb @@ -3,7 +3,7 @@ maintainer "Tom Hughes" maintainer_email "tom@compton.nu" license "Apache 2.0" description "Configures kernel parameters" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "0.1" %w(redhat centos debian ubuntu).each do |os| supports os diff --git a/cookbooks/sysfs/metadata.rb b/cookbooks/sysfs/metadata.rb index 50ab584ba..d1853f120 100644 --- a/cookbooks/sysfs/metadata.rb +++ b/cookbooks/sysfs/metadata.rb @@ -3,5 +3,5 @@ maintainer "Tom Hughes" maintainer_email "tom@compton.nu" license "Apache 2.0" description "Configures kernel parameters" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/taginfo/metadata.rb b/cookbooks/taginfo/metadata.rb index 2ba1d35be..9a747ef52 100644 --- a/cookbooks/taginfo/metadata.rb +++ b/cookbooks/taginfo/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures taginfo" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "passenger" diff --git a/cookbooks/thinkup/metadata.rb b/cookbooks/thinkup/metadata.rb index 3a613cd48..580905f47 100644 --- a/cookbooks/thinkup/metadata.rb +++ b/cookbooks/thinkup/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures ThinkUp" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "mysql" diff --git a/cookbooks/tile/files/default/ruby/expire.rb b/cookbooks/tile/files/default/ruby/expire.rb index f99d646e0..f129e3510 100755 --- a/cookbooks/tile/files/default/ruby/expire.rb +++ b/cookbooks/tile/files/default/ruby/expire.rb @@ -1,11 +1,11 @@ #!/usr/bin/ruby -require 'rubygems' -require 'proj4' -require 'xml/libxml' -require 'set' -require 'time' -require 'mmap' +require "rubygems" +require "proj4" +require "xml/libxml" +require "set" +require "time" +require "mmap" module Expire # projection object to go from latlon -> spherical mercator @@ -50,8 +50,8 @@ module Expire # generate the path hash_path = (0..4).collect do |i| (((x >> 4 * i) & 0xf) << 4) | ((y >> 4 * i) & 0xf) - end.reverse.join('/') - z.to_s + '/' + hash_path + ".meta" + end.reverse.join("/") + z.to_s + "/" + hash_path + ".meta" end # time to reset to, some very stupidly early time, before OSM started @@ -102,17 +102,17 @@ module Expire # we put all the nodes into the hash, as it doesn't matter whether the node was # added, deleted or modified - the tile will need updating anyway. - doc.find('//node').each do |node| - lat = node['lat'].to_f + doc.find("//node").each do |node| + lat = node["lat"].to_f if lat < -85 lat = -85 end if lat > 85 lat = 85 end - point = Proj4::Point.new(Math::PI * node['lon'].to_f / 180, + point = Proj4::Point.new(Math::PI * node["lon"].to_f / 180, Math::PI * lat / 180) - nodes[node['id'].to_i] = tile_from_latlon(point, max_zoom) + nodes[node["id"].to_i] = tile_from_latlon(point, max_zoom) end # now we look for all the ways that have changed and put all of their nodes into @@ -124,8 +124,8 @@ module Expire # itself deleted and the coverage of the point set isn't enough to encompass the # change. node_cache = NodeCache.new(NODE_CACHE_FILE) - doc.find('//way/nd').each do |node| - node_id = node['ref'].to_i + doc.find("//way/nd").each do |node| + node_id = node["ref"].to_i next if nodes.include? node_id diff --git a/cookbooks/tile/metadata.rb b/cookbooks/tile/metadata.rb index 32579802e..666f9d812 100644 --- a/cookbooks/tile/metadata.rb +++ b/cookbooks/tile/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures tile servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "git" diff --git a/cookbooks/tilecache/metadata.rb b/cookbooks/tilecache/metadata.rb index ed816a97b..6faf87174 100644 --- a/cookbooks/tilecache/metadata.rb +++ b/cookbooks/tilecache/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures a tile cache" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "ssl" depends "squid" diff --git a/cookbooks/tilelog/metadata.rb b/cookbooks/tilelog/metadata.rb index 0c75d9eb3..df11c69aa 100644 --- a/cookbooks/tilelog/metadata.rb +++ b/cookbooks/tilelog/metadata.rb @@ -1,9 +1,9 @@ -name 'tilelog' -maintainer 'OpenStreetMap Administrators' -maintainer_email 'admins@openstreetmap.org' -license 'Apache 2.0' -description 'Installs and configures tile log analysis' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.0.0' -depends 'git' -depends 'tools' +name "tilelog" +maintainer "OpenStreetMap Administrators" +maintainer_email "admins@openstreetmap.org" +license "Apache 2.0" +description "Installs and configures tile log analysis" +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) +version "1.0.0" +depends "git" +depends "tools" diff --git a/cookbooks/tools/metadata.rb b/cookbooks/tools/metadata.rb index b9b4d5bd3..a34657f76 100644 --- a/cookbooks/tools/metadata.rb +++ b/cookbooks/tools/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs system administration tools" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/trac/metadata.rb b/cookbooks/trac/metadata.rb index 2b1a75ad5..442b55a1d 100644 --- a/cookbooks/trac/metadata.rb +++ b/cookbooks/trac/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures trac servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" diff --git a/cookbooks/web/metadata.rb b/cookbooks/web/metadata.rb index 1ef28bbbb..780e9307f 100644 --- a/cookbooks/web/metadata.rb +++ b/cookbooks/web/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures www.openstreetmap.org servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "passenger" diff --git a/cookbooks/wiki/metadata.rb b/cookbooks/wiki/metadata.rb index b93706b8e..0bf885ab2 100644 --- a/cookbooks/wiki/metadata.rb +++ b/cookbooks/wiki/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures servers for wiki.openstreetmap.org" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "mediawiki" depends "squid" diff --git a/cookbooks/wordpress/libraries/wordpress.rb b/cookbooks/wordpress/libraries/wordpress.rb index 06a375fe9..f4f17e220 100644 --- a/cookbooks/wordpress/libraries/wordpress.rb +++ b/cookbooks/wordpress/libraries/wordpress.rb @@ -1,4 +1,4 @@ -require 'chef/mixin/command' +require "chef/mixin/command" class Chef module Wordpress diff --git a/cookbooks/wordpress/metadata.rb b/cookbooks/wordpress/metadata.rb index 757b72a8f..eaf4976da 100644 --- a/cookbooks/wordpress/metadata.rb +++ b/cookbooks/wordpress/metadata.rb @@ -3,7 +3,7 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures Wordpress" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache" depends "chef" diff --git a/cookbooks/xinetd/metadata.rb b/cookbooks/xinetd/metadata.rb index 56f62330a..79f029256 100644 --- a/cookbooks/xinetd/metadata.rb +++ b/cookbooks/xinetd/metadata.rb @@ -3,5 +3,5 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Configures xinetd" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" diff --git a/cookbooks/yournavigation/metadata.rb b/cookbooks/yournavigation/metadata.rb index c976f41d9..24c6cc843 100644 --- a/cookbooks/yournavigation/metadata.rb +++ b/cookbooks/yournavigation/metadata.rb @@ -3,6 +3,6 @@ maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache 2.0" description "Installs and configures yournavigation servers" -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" depends "apache"