]> git.openstreetmap.org Git - rails.git/blob - config/environment.rb
Make the API consistent about whether object names are plural in
[rails.git] / config / environment.rb
1 # Be sure to restart your web server when you modify this file.
2
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'
6
7 # Don't add asset tags
8 ENV["RAILS_ASSET_ID"] = ''
9
10 # Specifies gem version of Rails to use when vendor/rails is not present
11 RAILS_GEM_VERSION = '1.2.3'
12
13 # Bootstrap the Rails environment, frameworks, and default configuration
14 require File.join(File.dirname(__FILE__), 'boot')
15
16 # Application constants needed for routes.rb - must go before Initializer call
17 API_VERSION = ENV['OSM_API_VERSION'] || '0.4'
18
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+/, "")]
23   end
24 end
25
26 Rails::Initializer.run do |config|
27   # Settings in config/environments/* take precedence those specified here
28   
29   # Skip frameworks you're not going to use
30   # config.frameworks -= [ :action_web_service, :action_mailer ]
31
32   # Add additional load paths for your own custom dirs
33   # config.load_paths += %W( #{RAILS_ROOT}/extras )
34
35   # Force all environments to use the same logger level 
36   # (by default production uses :info, the others :debug)
37   # config.log_level = :debug
38
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)
42
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
46
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
51
52   # Activate observers that should always be running
53   # config.active_record.observers = :cacher, :garbage_collector
54
55   # Make Active Record use UTC-base instead of local time
56   # config.active_record.default_timezone = :utc
57   
58   # See Rails::Configuration for more options
59 end
60
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 )
68 # end
69
70 # Include your application configuration below
71 SERVER_URL = ENV['OSM_SERVER_URL'] || 'www.openstreetmap.org'
72
73 ActionMailer::Base.smtp_settings = {
74   :address  => "localhost",
75   :port  => 25, 
76   :domain  => 'localhost',
77
78
79
80 # HTTP CODES
81
82 # 200's
83
84 HTTP_OK = 200
85
86 # 400's
87
88 HTTP_PRECONDITION_FAILED = 412
89 HTTP_EXPECTATION_FAILED = 417
90
91 #Taming FCGI
92 #
93 COUNT = 0
94 MAX_COUNT = 10000
95
96
97
98