Style/SingleSpaceBeforeFirstArg:
Exclude:
- '**/metadata.rb'
+
+Style/StringLiterals:
+ EnforcedStyle: double_quotes
# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 11
-
-# Offense count: 6548
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/StringLiterals:
- Enabled: false
-source 'https://rubygems.org'
+source "https://rubygems.org"
-gem 'rubocop'
-gem 'foodcritic'
+gem "rubocop"
+gem "foodcritic"
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",
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"
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"
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"
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"
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"
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"
-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"
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
)
end
def current_repository
- @current_repository ||= repo_attrs['URL']
+ @current_repository ||= repo_attrs["URL"]
end
def current_repository_matches_target_repository?
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"
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"
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"
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"
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"
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",
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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
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"
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"
#!/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
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"
#!/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
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"
#!/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
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"
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"
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",
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
#!/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
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)
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
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
# 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
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
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"
-require 'chef/mixin/command'
+require "chef/mixin/command"
class Chef
class PostgreSQL
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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
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"
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"
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"
#!/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
# 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
# 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
# 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
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"
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"
-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"
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"
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"
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"
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"
-require 'chef/mixin/command'
+require "chef/mixin/command"
class Chef
module Wordpress
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"
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"
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"