From d9b92ee11b33fed5c7a94a91415fa846705f7dd3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 18 Nov 2008 14:23:13 +0100 Subject: Added config.i18n settings gatherer to config/environment, auto-loading of all locales in config/locales/*.rb,yml, and config/locales/en.yml as a sample locale [DHH] --- railties/environments/environment.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index f27ccc6bb8..8fef8ff610 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -45,6 +45,11 @@ Rails::Initializer.run do |config| # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time. config.time_zone = 'UTC' + # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths. + # All files from config/locales/*.rb,yml are added automatically. + # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')] + # config.i18n.default_locale = :de + # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid! # Make sure the secret is at least 30 characters and all random, -- cgit v1.2.3 From 53eba2f21831b8111233d3eae676a88f9f4a9a44 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 19 Nov 2008 12:31:34 +0100 Subject: The docs in environment.rb are not going to be rendered so it doesnt make sense to mark them up --- railties/environments/environment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 8fef8ff610..2187174bd5 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -22,7 +22,7 @@ Rails::Initializer.run do |config| # Specify gems that this application depends on. # They can then be installed with "rake gems:install" on new installations. - # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (_sqlite3_) + # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (_sqlite3_) # config.gem "bj" # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "sqlite3-ruby", :lib => "sqlite3" -- cgit v1.2.3 From 0c9f677e7861ef2aae36d91811d72794e4709f58 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 19 Nov 2008 12:36:53 +0100 Subject: Another piece of markup removed from environment.rb --- railties/environments/environment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 2187174bd5..5cb201401b 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -22,7 +22,7 @@ Rails::Initializer.run do |config| # Specify gems that this application depends on. # They can then be installed with "rake gems:install" on new installations. - # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (_sqlite3_) + # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3) # config.gem "bj" # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "sqlite3-ruby", :lib => "sqlite3" -- cgit v1.2.3 From 5c26b2e47bba39055c138c36eaf5e43ee7fe0ffb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 14:44:56 -0600 Subject: Its no longer common to run Rails in environments where you cant set the environment to be the production one. Dont need a notice telling about the ENV var that prominently any more --- railties/environments/environment.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 5cb201401b..1d27df2372 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -1,9 +1,5 @@ # Be sure to restart your 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 <%= '# ' if freeze %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION -- cgit v1.2.3 From 0eac9daa0a333ede2252203a67f86638f0e811c8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 14:46:11 -0600 Subject: Rails::Configuration never had more details. Stop lying about it --- railties/environments/environment.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 1d27df2372..49c6a5c888 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -10,7 +10,6 @@ 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. - # See Rails::Configuration for more options. # Skip frameworks you're not going to use. To use Rails without a database # you must remove the Active Record framework. -- cgit v1.2.3 From 201b64b4e1fd007c8da1374da4196f24e2661f21 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 14:53:22 -0600 Subject: Cleanup other examples and wording --- railties/environments/environment.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 49c6a5c888..b1a0604abf 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -11,20 +11,17 @@ Rails::Initializer.run do |config| # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # Skip frameworks you're not going to use. To use Rails without a database + # 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 ] - # Specify gems that this application depends on. - # They can then be installed with "rake gems:install" on new installations. - # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3) + # 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" - # Only load the plugins named here, in the order given. By default, all plugins - # in vendor/plugins are loaded in alphabetical order. + # 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 ] @@ -40,9 +37,9 @@ Rails::Initializer.run do |config| # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time. config.time_zone = 'UTC' - # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths. + # The internationalization framework can be changed to have another default locale (default is :en) or more load paths. # All files from config/locales/*.rb,yml are added automatically. - # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')] + # config.i18n.load_path << Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de # Your secret key for verifying cookie session data integrity. @@ -65,6 +62,5 @@ Rails::Initializer.run do |config| # config.active_record.schema_format = :sql # Activate observers that should always be running - # Please note that observers generated using script/generate observer need to have an _observer suffix # config.active_record.observers = :cacher, :garbage_collector, :forum_observer end -- cgit v1.2.3 From 6358e6c1078cfdbdee627a4fbde1e2b0c597af35 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 15:06:55 -0600 Subject: More organization based on priority --- railties/environments/environment.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index b1a0604abf..66f71e5d9b 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -11,9 +11,8 @@ Rails::Initializer.run do |config| # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # 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 ] + # 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" @@ -25,12 +24,9 @@ Rails::Initializer.run do |config| # :all can be used as a placeholder for all plugins not explicitly named # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - # 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 + # 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 ] # Make Time.zone default to the specified zone, and make Active Record store time values # in the database in UTC, and return them converted to the specified local zone. -- cgit v1.2.3 From 6e66e7d6460b99bb0877a891aa3fbb789b563123 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 15:53:21 -0600 Subject: Even more polish of the default configration files and split off the session store configuration into its own file --- railties/environments/environment.rb | 37 ++++++++---------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 66f71e5d9b..392e12f438 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -12,7 +12,7 @@ Rails::Initializer.run do |config| # -- 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 ) + # 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" @@ -28,35 +28,14 @@ Rails::Initializer.run do |config| # you must remove the Active Record framework. # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] - # Make Time.zone default to the specified zone, and make Active Record store time values - # in the database in UTC, and return them converted to the specified local zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time. + # 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' - # The internationalization framework can be changed to have another default locale (default is :en) or more load paths. - # All files from config/locales/*.rb,yml are added automatically. + # 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 - - # Your secret key for verifying cookie session data integrity. - # If you change this key, all old sessions will become invalid! - # Make sure the secret is at least 30 characters and all random, - # no regular words or you'll be exposed to dictionary attacks. - config.action_controller.session = { - :session_key => '_<%= app_name %>_session', - :secret => '<%= app_secret %>' - } - - # Use the database for sessions instead of the cookie-based default, - # which shouldn't be used to store highly confidential information - # (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, :forum_observer -end +end \ No newline at end of file -- cgit v1.2.3 From bf024b6a11253b3d2599caf41f7ccf2d31e68cb3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 1 Dec 2008 23:06:29 -0600 Subject: Github comments are an excellent way to perform community code review -- keep it up! --- railties/environments/environment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/environments/environment.rb') diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 392e12f438..4a2df36307 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -12,7 +12,7 @@ Rails::Initializer.run do |config| # -- 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 ) + # 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" @@ -36,6 +36,6 @@ Rails::Initializer.run do |config| 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.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de end \ No newline at end of file -- cgit v1.2.3