]> git.openstreetmap.org Git - rails.git/commitdiff
add config, rm logs (why does rails do this!?)
authorSteve Coast <steve@asklater.com>
Fri, 28 Jul 2006 21:42:12 +0000 (21:42 +0000)
committerSteve Coast <steve@asklater.com>
Fri, 28 Jul 2006 21:42:12 +0000 (21:42 +0000)
config/boot.rb [new file with mode: 0644]
config/database.yml [new file with mode: 0644]
config/environment.rb [new file with mode: 0644]
config/environments/development.rb [new file with mode: 0644]
config/environments/production.rb [new file with mode: 0644]
config/environments/test.rb [new file with mode: 0644]
config/routes.rb [new file with mode: 0644]
log/development.log [deleted file]
log/production.log [deleted file]
log/server.log [deleted file]
log/test.log [deleted file]

diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644 (file)
index 0000000..9a094cb
--- /dev/null
@@ -0,0 +1,44 @@
+# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
+
+unless defined?(RAILS_ROOT)
+  root_path = File.join(File.dirname(__FILE__), '..')
+
+  unless RUBY_PLATFORM =~ /mswin32/
+    require 'pathname'
+    root_path = Pathname.new(root_path).cleanpath(true).to_s
+  end
+
+  RAILS_ROOT = root_path
+end
+
+unless defined?(Rails::Initializer)
+  if File.directory?("#{RAILS_ROOT}/vendor/rails")
+    require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+  else
+    require 'rubygems'
+
+    environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
+    environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
+    rails_gem_version = $1
+
+    if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
+      rails_gem = Gem.cache.search('rails', "=#{version}").first
+
+      if rails_gem
+        require_gem "rails", "=#{version}"
+        require rails_gem.full_gem_path + '/lib/initializer'
+      else
+        STDERR.puts %(Cannot find gem for Rails =#{version}:
+    Install the missing gem with 'gem install -v=#{version} rails', or
+    change environment.rb to define RAILS_GEM_VERSION with your desired version.
+  )
+        exit 1
+      end
+    else
+      require_gem "rails"
+      require 'initializer'
+    end
+  end
+
+  Rails::Initializer.run(:set_load_path)
+end
\ No newline at end of file
diff --git a/config/database.yml b/config/database.yml
new file mode 100644 (file)
index 0000000..d366bc9
--- /dev/null
@@ -0,0 +1,35 @@
+# MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
+#
+# Install the MySQL driver:
+#   gem install mysql
+# On MacOS X:
+#   gem install mysql -- --include=/usr/local/lib
+# On Windows:
+#   There is no gem for Windows.  Install mysql.so from RubyForApache.
+#   http://rubyforge.org/projects/rubyforapache
+#
+# And be sure to use new-style password hashing:
+#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
+development:
+  adapter: mysql
+  database: osm
+  username: openstreetmap
+  password: openstreetmap
+  host: localhost
+
+# Warning: The database defined as 'test' will be erased and
+# re-generated from your development database when you run 'rake'.
+# Do not set this db to the same as development or production.
+test:
+  adapter: mysql
+  database: osm_test
+  username: root
+  password:
+  host: localhost
+
+production:
+  adapter: mysql
+  database: openstreetmap
+  username: openstreetmap
+  password: openstreetmap
+  host: db.openstreetmap.org
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644 (file)
index 0000000..03e9560
--- /dev/null
@@ -0,0 +1,53 @@
+# Be sure to restart your web server when you modify this file.
+
+# Uncomment below to force Rails into production mode when 
+# you don't control web/app server and can't set it the proper way
+# ENV['RAILS_ENV'] ||= 'production'
+
+# Specifies gem version of Rails to use when vendor/rails is not present
+RAILS_GEM_VERSION = '1.1.4'
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+Rails::Initializer.run do |config|
+  # Settings in config/environments/* take precedence those specified here
+  
+  # Skip frameworks you're not going to use
+  # config.frameworks -= [ :action_web_service, :action_mailer ]
+
+  # Add additional load paths for your own custom dirs
+  # config.load_paths += %W( #{RAILS_ROOT}/extras )
+
+  # Force all environments to use the same logger level 
+  # (by default production uses :info, the others :debug)
+  # config.log_level = :debug
+
+  # Use the database for sessions instead of the file system
+  # (create the session table with 'rake db:sessions:create')
+  # config.action_controller.session_store = :active_record_store
+
+  # Use SQL instead of Active Record's schema dumper when creating the test database.
+  # This is necessary if your schema can't be completely dumped by the schema dumper, 
+  # like if you have constraints or database-specific column types
+  # config.active_record.schema_format = :sql
+
+  # Activate observers that should always be running
+  # config.active_record.observers = :cacher, :garbage_collector
+
+  # Make Active Record use UTC-base instead of local time
+  # config.active_record.default_timezone = :utc
+  
+  # See Rails::Configuration for more options
+end
+
+# Add new inflection rules using the following format 
+# (all these examples are active by default):
+# Inflector.inflections do |inflect|
+#   inflect.plural /^(ox)$/i, '\1en'
+#   inflect.singular /^(ox)en/i, '\1'
+#   inflect.irregular 'person', 'people'
+#   inflect.uncountable %w( fish sheep )
+# end
+
+# Include your application configuration below
\ No newline at end of file
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644 (file)
index 0000000..0589aa9
--- /dev/null
@@ -0,0 +1,21 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# In the development environment your application's code is reloaded on
+# every request.  This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Enable the breakpoint server that script/breakpointer connects to
+config.breakpoint_server = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching             = false
+config.action_view.cache_template_extensions         = false
+config.action_view.debug_rjs                         = true
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644 (file)
index 0000000..5a4e2b1
--- /dev/null
@@ -0,0 +1,18 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching             = true
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host                  = "http://assets.example.com"
+
+# Disable delivery errors if you bad email addresses should just be ignored
+# config.action_mailer.raise_delivery_errors = false
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644 (file)
index 0000000..f0689b9
--- /dev/null
@@ -0,0 +1,19 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The test environment is used exclusively to run your application's
+# test suite.  You never need to work with it otherwise.  Remember that
+# your test database is "scratch space" for the test suite and is wiped
+# and recreated between test runs.  Don't rely on the data there!
+config.cache_classes = true
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching             = false
+
+# Tell ActionMailer not to deliver emails to the real world.
+# The :test delivery method accumulates sent emails in the
+# ActionMailer::Base.deliveries array.
+config.action_mailer.delivery_method = :test
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644 (file)
index 0000000..828e0f4
--- /dev/null
@@ -0,0 +1,15 @@
+ActionController::Routing::Routes.draw do |map|
+  map.connect ':controller/service.wsdl', :action => 'wsdl'
+
+
+  map.connect '/api/0.4/node/:id', :controller => 'node', :action => 'rest'
+  map.connect '/api/0.4/node/create', :controller => 'node', :action => 'create'
+  map.connect '/api/0.4/segment/:id', :controller => 'segment', :action => 'rest'
+  map.connect '/api/0.4/segment/create', :controller => 'segment', :action => 'create'
+
+  map.connect '/api/0.4/way/:id', :controller => 'way', :action => 'rest'
+  map.connect '/api/0.4/way/create', :controller => 'way', :action => 'create'
+  map.connect ':controller/:action/:id'
+end
diff --git a/log/development.log b/log/development.log
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/log/production.log b/log/production.log
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/log/server.log b/log/server.log
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/log/test.log b/log/test.log
deleted file mode 100644 (file)
index e69de29..0000000