From 4494a752c3c568c65fa899c54486153a1a5fa187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 23 Jun 2009 19:10:42 +0200 Subject: Change current sstructure. --- .../rails/app/templates/config/environment.rb | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 railties/lib/generators/rails/app/templates/config/environment.rb (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb new file mode 100644 index 0000000000..d1080cb529 --- /dev/null +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -0,0 +1,45 @@ +# Be sure to restart your server when you modify this file + +# Specifies gem version of Rails to use when vendor/rails is not present +<%= '# ' if options[:freeze] %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION + +# 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 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" + + # 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. +<%- if options[:skip_activerecord] -%> + config.frameworks -= [ :active_record ] +<%- else -%> + # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] + + # Activate observers that should always be running + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer +<%- end -%> + + # 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 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 +end -- cgit v1.2.3 From 8c5622f0d4d3b5c6bce52b0eb22756a83060b1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 27 Jun 2009 13:03:07 +0200 Subject: Initial scratch of model generators. --- railties/lib/generators/rails/app/templates/config/environment.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb index d1080cb529..84c5abf1e9 100644 --- a/railties/lib/generators/rails/app/templates/config/environment.rb +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -26,14 +26,14 @@ Rails::Initializer.run do |config| # Skip frameworks you're not going to use. To use Rails without a database, # you must remove the Active Record framework. -<%- if options[:skip_activerecord] -%> +<% if options[:skip_activerecord] -%> config.frameworks -= [ :active_record ] -<%- else -%> +<% else -%> # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] # Activate observers that should always be running # config.active_record.observers = :cacher, :garbage_collector, :forum_observer -<%- end -%> +<% end -%> # 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. -- cgit v1.2.3 From f68e7a3987adf2cffe0e48263d117839c2028185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 13 Jul 2009 18:18:08 +0200 Subject: Remove generator environment until we have a gem manifest. --- .../rails/app/templates/config/environment.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb index 84c5abf1e9..02fbb57b87 100644 --- a/railties/lib/generators/rails/app/templates/config/environment.rb +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -42,4 +42,23 @@ Rails::Initializer.run do |config| # 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 + + # Configure generators default options. + config.generators do |g| + # Scaffold configuration + g.helper = true + g.layout = true + g.stylesheets = true + + # ORM configuration + g.orm = :active_record + g.timestamps = true + + # Template engine configuration + g.template_engine = :erb + + # Test framework configuration + g.test_framework = :test_unit + g.fixtures = true + end end -- cgit v1.2.3 From 7022b58842ec3490d85efc5b947d86a0fd72d0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 15 Jul 2009 16:20:48 +0200 Subject: Allow namespaced configuration on generators. --- .../rails/app/templates/config/environment.rb | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb index 02fbb57b87..59c1f0bfb2 100644 --- a/railties/lib/generators/rails/app/templates/config/environment.rb +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -45,20 +45,22 @@ Rails::Initializer.run do |config| # Configure generators default options. config.generators do |g| - # Scaffold configuration - g.helper = true - g.layout = true - g.stylesheets = true + g.rails do |r| + r.helper = true + r.stylesheets = true + end - # ORM configuration - g.orm = :active_record - g.timestamps = true + g.orm :active_record do |ar| + ar.migration = true + ar.timestamps = true + end - # Template engine configuration - g.template_engine = :erb + g.template_engine :erb do |erb| + erb.layout = true + end - # Test framework configuration - g.test_framework = :test_unit - g.fixtures = true + g.test_framework :test_unit do |tu| + tu.fixtures = true + end end end -- cgit v1.2.3 From 9c4ba74b7cd74b0312425ecc8c5b57aa6cf8c0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 15 Jul 2009 23:38:41 +0200 Subject: Change generators configuration to have a hash style. --- .../rails/app/templates/config/environment.rb | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb index 59c1f0bfb2..94c90475c6 100644 --- a/railties/lib/generators/rails/app/templates/config/environment.rb +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -43,24 +43,11 @@ Rails::Initializer.run do |config| # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de - # Configure generators default options. + # Configure generators values. Many other options are available, be sure to + # check the documentation. config.generators do |g| - g.rails do |r| - r.helper = true - r.stylesheets = true - end - - g.orm :active_record do |ar| - ar.migration = true - ar.timestamps = true - end - - g.template_engine :erb do |erb| - erb.layout = true - end - - g.test_framework :test_unit do |tu| - tu.fixtures = true - end + g.orm :active_record + g.template_engine :erb + g.test_framework :test_unit, :fixture => true end end -- cgit v1.2.3 From 83537bf09010a56510927939f3ea31d30f612a25 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Thu, 30 Jul 2009 17:49:05 +0100 Subject: Generator config should be commented by default --- .../lib/generators/rails/app/templates/config/environment.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'railties/lib/generators/rails/app/templates/config/environment.rb') diff --git a/railties/lib/generators/rails/app/templates/config/environment.rb b/railties/lib/generators/rails/app/templates/config/environment.rb index 94c90475c6..adb3a3060a 100644 --- a/railties/lib/generators/rails/app/templates/config/environment.rb +++ b/railties/lib/generators/rails/app/templates/config/environment.rb @@ -45,9 +45,9 @@ Rails::Initializer.run do |config| # Configure generators values. Many other options are available, be sure to # check the documentation. - config.generators do |g| - g.orm :active_record - g.template_engine :erb - g.test_framework :test_unit, :fixture => true - end + # config.generators do |g| + # g.orm :active_record + # g.template_engine :erb + # g.test_framework :test_unit, :fixture => true + # end end -- cgit v1.2.3