Skip to content

Commit

Permalink
Adding example database yml, setup for bundler in boot process
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Humphries and Jon Distad committed Oct 1, 2010
1 parent 6299c6c commit 218bf5c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ public/javascripts/cache-application.js
public/stylesheets/cache-application.css public/stylesheets/cache-application.css
coverage.data coverage.data
test/coverage test/coverage
.bundle
14 changes: 14 additions & 0 deletions config/boot.rb
Expand Up @@ -106,5 +106,19 @@ def read_environment_rb
end end
end end


class Rails::Boot
def run
load_initializer

Rails::Initializer.class_eval do
def load_gems
@bundler_loaded ||= Bundler.require :default, Rails.env
end
end

Rails::Initializer.run(:set_load_path)
end
end

# All that for this: # All that for this:
Rails.boot! Rails.boot!
25 changes: 25 additions & 0 deletions config/database.example.yml
@@ -0,0 +1,25 @@
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
host: 127.0.0.1
adapter: mysql
database: clojuredocs
username: root
password:

# 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:
host: 127.0.0.1
adapter: mysql
database: clojuredocs_test
username: root
password:

production:
host: 127.0.0.1
adapter: mysql
database: clojuredocs
username: root
password:
12 changes: 6 additions & 6 deletions config/database.yml
Expand Up @@ -11,15 +11,15 @@ development:
# re-generated from your development database when you run "rake". # re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production. # Do not set this db to the same as development or production.
test: test:
host: 127.0.0.1 host: 127.0.0.1
adapter: mysql adapter: mysql
database: clojuredocs_test database: clojuredocs_test
username: root username: root
password: password:


production: production:
host: 127.0.0.1 host: 127.0.0.1
adapter: mysql adapter: mysql
database: clojuredocs database: clojuredocs
username: root username: root
password: password:
45 changes: 1 addition & 44 deletions config/environment.rb
Expand Up @@ -8,52 +8,9 @@
require 'digest/md5' require 'digest/md5'


Rails::Initializer.run do |config| Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.

# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )

# Specify gems that this application depends on and have them installed with rake gems:install
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"

# config.gem "ruby-openid", :version => '2.1.2'
# config.gem "rack-openid", :version => '1.0.3'
config.gem "shoulda", :lib => "shoulda"
config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org'
config.gem 'levenshtein', :version => '0.2.0'
config.gem 'rdiscount', :version => '1.6.5'
config.gem 'chronic', :version => '0.2.3'
# config.gem 'json_pure', :version => '1.4.3'
config.gem 'flexmock', :version => '0.8.7'

# config.gem 'rubytree', :version => '0.7.0'

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]

# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC' config.time_zone = 'UTC'


# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de

config.action_controller.perform_caching = true config.action_controller.perform_caching = true


ROOT_URL = "http://localhost:3000" ROOT_URL = "http://localhost:3000"

end
end

0 comments on commit 218bf5c

Please sign in to comment.