diff options
Diffstat (limited to 'railties/lib/rails')
13 files changed, 22 insertions, 16 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 6a125685d0..e26f73ed8d 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -522,9 +522,9 @@ module Rails end initializer :append_assets_path do |app| - app.config.assets.paths.unshift *paths["vendor/assets"].existent - app.config.assets.paths.unshift *paths["lib/assets"].existent - app.config.assets.paths.unshift *paths["app/assets"].existent + app.config.assets.paths.unshift(*paths["vendor/assets"].existent) + app.config.assets.paths.unshift(*paths["lib/assets"].existent) + app.config.assets.paths.unshift(*paths["app/assets"].existent) end initializer :prepend_helpers_path do |app| diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index c323df3e95..d31a3262e3 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -278,7 +278,7 @@ module Rails say args.first.to_s unless options.quiet? else args << (self.behavior == :invoke ? :green : :red) - say_status *args + say_status(*args) end end diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index a5743762e5..8512b1ca4a 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -165,7 +165,7 @@ module Rails end def gem_for_ruby_debugger - if RUBY_VERSION < "1.9.2" + if RUBY_VERSION < "1.9" "gem 'ruby-debug'" else "gem 'ruby-debug19', :require => 'ruby-debug'" @@ -173,7 +173,7 @@ module Rails end def gem_for_turn - unless RUBY_VERSION < "1.9.2" + unless RUBY_VERSION < "1.9.2" || options[:skip_test_unit] <<-GEMFILE.strip_heredoc group :test do # Pretty printed test output diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb index d12b2ff0e5..32546936e3 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb @@ -11,7 +11,7 @@ </div> <%% end %> -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <div class="field"> <%%= f.label :<%= attribute.name %> %><br /> <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %> diff --git a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb index a7393cfe18..7b1a2a1841 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb @@ -2,7 +2,7 @@ <table> <tr> -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <th><%= attribute.human_name %></th> <% end -%> <th></th> @@ -12,7 +12,7 @@ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> <tr> -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td> <% end -%> <td><%%= link_to 'Show', <%= singular_table_name %> %></td> diff --git a/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb index c0e5ccff1e..67f263efbb 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/show.html.erb @@ -1,6 +1,6 @@ <p id="notice"><%%= notice %></p> -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <p> <b><%= attribute.human_name %>:</b> <%%= @<%= singular_table_name %>.<%= attribute.name %> %> diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index cf317eb21f..7e7f8d2d08 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -13,6 +13,7 @@ module Rails :desc => "Force using old style hash (:foo => 'bar') on Ruby >= 1.9" def initialize(args, *options) #:nodoc: + @inside_template = nil # Unfreeze name in case it's given as a frozen string args[0] = args[0].dup if args[0].is_a?(String) && args[0].frozen? super diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml index 62dc7b2c48..cce166c7c3 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml @@ -1,4 +1,7 @@ # MySQL. Versions 4.1 and 5.0 are recommended. +# +# Install the MYSQL driver +# gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem 'mysql2' diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml index 5989eaf9dd..51a4dd459d 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml @@ -1,4 +1,6 @@ # SQLite version 3.x +# gem install sqlite3 +# # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' development: diff --git a/railties/lib/rails/generators/rails/controller/templates/controller.rb b/railties/lib/rails/generators/rails/controller/templates/controller.rb index c61ea4b510..8f5f78556f 100644 --- a/railties/lib/rails/generators/rails/controller/templates/controller.rb +++ b/railties/lib/rails/generators/rails/controller/templates/controller.rb @@ -1,6 +1,6 @@ <% module_namespacing do -%> class <%= class_name %>Controller < ApplicationController -<% for action in actions -%> +<% actions.each do |action| -%> def <%= action %> end diff --git a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb index 0bc5fd8ca2..509bd60564 100644 --- a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb @@ -7,7 +7,7 @@ class <%= class_name %>ControllerTest < ActionController::TestCase # assert true # end <% else -%> -<% for action in actions -%> +<% actions.each do |action| -%> test "should get <%= action %>" do get :<%= action %> assert_response :success diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb index c05102290c..7e204105a3 100644 --- a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb @@ -2,7 +2,7 @@ require 'test_helper' <% module_namespacing do -%> class <%= class_name %>Test < ActionMailer::TestCase -<% for action in actions -%> +<% actions.each do |action| -%> test "<%= action %>" do mail = <%= class_name %>.<%= action %> assert_equal <%= action.to_s.humanize.inspect %>, mail.subject diff --git a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml index 6465a6a6e2..d4138ca2f5 100644 --- a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml +++ b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml @@ -2,12 +2,12 @@ <% unless attributes.empty? -%> one: -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> two: -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> <% else -%> @@ -20,4 +20,4 @@ one: {} # two: {} # column: value -<% end -%>
\ No newline at end of file +<% end -%> |