1 unless Object.const_defined?(:Rake) or Object.const_defined?(:POTLATCH2_KEY)
2 OpenStreetMap::Application.config.after_initialize do
3 unless webmaster = User.find_by_email("webmaster@openstreetmap.org")
5 webmaster.display_name = "OpenStreetMap Webmaster"
6 webmaster.email = "webmaster@openstreetmap.org"
7 webmaster.pass_crypt = SecureRandom.hex
8 webmaster.status = "active"
12 permissions = Hash[ClientApplication.all_permissions.map { |p| [ p, true ] }]
14 unless id = webmaster.client_applications.find_by_name("iD")
15 id = ClientApplication.new
17 id.url = "http://<%= @site %>/"
23 unless potlatch = webmaster.client_applications.find_by_name("Potlatch 2")
24 potlatch = ClientApplication.new
25 potlatch.name = "Potlatch 2"
26 potlatch.url = "http://<%= @site %>/"
30 POTLATCH2_KEY = potlatch.key
32 unless website = webmaster.client_applications.find_by_name("Web Site")
33 website = ClientApplication.new
34 website.name = "Web Site"
35 website.url = "http://<%= @site %>/"
39 OAUTH_KEY = website.key