1 # Be sure to restart your web server when you modify this file.
3 # Uncomment below to force Rails into production mode when
4 # you don't control web/app server and can't set it the proper way
5 ENV['RAILS_ENV'] ||= 'production'
8 ENV["RAILS_ASSET_ID"] = ''
10 # Specifies gem version of Rails to use when vendor/rails is not present
11 RAILS_GEM_VERSION = '1.2.3'
13 # Bootstrap the Rails environment, frameworks, and default configuration
14 require File.join(File.dirname(__FILE__), 'boot')
16 # Application constants needed for routes.rb - must go before Initializer call
17 API_VERSION = ENV['OSM_API_VERSION'] || '0.4'
19 # Custom logger class to format messages sensibly
20 class OSMLogger < Logger
21 def format_message(severity, time, progname, msg)
22 "[%s.%06d #%d] %s\n" % [time.strftime("%Y-%m-%d %H:%M:%S"), time.usec, $$, msg.sub(/^\n+/, "")]
26 Rails::Initializer.run do |config|
27 # Settings in config/environments/* take precedence those specified here
29 # Skip frameworks you're not going to use
30 # config.frameworks -= [ :action_web_service, :action_mailer ]
32 # Add additional load paths for your own custom dirs
33 # config.load_paths += %W( #{RAILS_ROOT}/extras )
35 # Force all environments to use the same logger level
36 # (by default production uses :info, the others :debug)
37 # config.log_level = :debug
39 # Use our custom logger
40 config.logger = OSMLogger.new(config.log_path)
41 config.logger.level = Logger.const_get(config.log_level.to_s.upcase)
43 # Use the database for sessions instead of the file system
44 # (create the session table with 'rake db:sessions:create')
45 # config.action_controller.session_store = :active_record_store
47 # Use SQL instead of Active Record's schema dumper when creating the test database.
48 # This is necessary if your schema can't be completely dumped by the schema dumper,
49 # like if you have constraints or database-specific column types
50 config.active_record.schema_format = :sql
52 # Activate observers that should always be running
53 # config.active_record.observers = :cacher, :garbage_collector
55 # Make Active Record use UTC-base instead of local time
56 # config.active_record.default_timezone = :utc
58 # See Rails::Configuration for more options
61 # Add new inflection rules using the following format
62 # (all these examples are active by default):
63 # Inflector.inflections do |inflect|
64 # inflect.plural /^(ox)$/i, '\1en'
65 # inflect.singular /^(ox)en/i, '\1'
66 # inflect.irregular 'person', 'people'
67 # inflect.uncountable %w( fish sheep )
70 # Set to true to put the API in read-only mode
73 # Include your application configuration below
74 SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
76 ActionMailer::Base.smtp_settings = {
77 :address => "localhost",
79 :domain => 'localhost',
91 HTTP_PRECONDITION_FAILED = 412
92 HTTP_EXPECTATION_FAILED = 417