diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/controller/controller_generator.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/rack/logger.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/templates/rails/welcome/index.html.erb | 13 | ||||
-rw-r--r-- | railties/test/generators_test.rb | 6 | ||||
-rw-r--r-- | railties/test/path_generation_test.rb | 6 |
5 files changed, 23 insertions, 8 deletions
diff --git a/railties/lib/rails/generators/rails/controller/controller_generator.rb b/railties/lib/rails/generators/rails/controller/controller_generator.rb index 6c583e5811..0a4c509a31 100644 --- a/railties/lib/rails/generators/rails/controller/controller_generator.rb +++ b/railties/lib/rails/generators/rails/controller/controller_generator.rb @@ -19,7 +19,8 @@ module Rails end end - hook_for :template_engine, :test_framework, :helper, :assets + hook_for :template_engine, :test_framework + hook_for :helper, :assets, hide: true private diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb index 9962e6d943..7aaa353b91 100644 --- a/railties/lib/rails/rack/logger.rb +++ b/railties/lib/rails/rack/logger.rb @@ -7,6 +7,9 @@ require 'rack/body_proxy' module Rails module Rack # Sets log tags, logs the request, calls the app, and flushes the logs. + # + # Log tags (+taggers+) can be an Array containing: methods that the <tt>request</tt> object responds to, a Proc + # that accepts an instance of the <tt>request</tt> object, or something that responds to <tt>to_s</tt>. class Logger < ActiveSupport::LogSubscriber def initialize(app, taggers = nil) @app = app diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb index 6726c23fc9..acf04af416 100644 --- a/railties/lib/rails/templates/rails/welcome/index.html.erb +++ b/railties/lib/rails/templates/rails/welcome/index.html.erb @@ -18,7 +18,9 @@ color: #000; } - a {color: #03c} + a { + color: #03c; + } a:hover { background-color: #03c; @@ -64,7 +66,10 @@ height: 64px; } - #header h1, #header h2 {margin: 0} + #header h1, + #header h2 { + margin: 0; + } #header h2 { color: #888; @@ -104,7 +109,9 @@ color: #555; } - #about-content td.value {color: #000} + #about-content td.value { + color: #000; + } #about-content ul { padding: 0; diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 127e059bf1..fdcfb30090 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -34,6 +34,12 @@ class GeneratorsTest < Rails::Generators::TestCase assert_match "Maybe you meant 'migration'", output end + def test_generator_multiple_suggestions + name = :tas + output = capture(:stdout){ Rails::Generators.invoke name } + assert_match "Maybe you meant 'task', 'job' or 'assets'", output + end + def test_help_when_a_generator_with_required_arguments_is_invoked_without_arguments output = capture(:stdout){ Rails::Generators.invoke :model, [] } assert_match(/Description:/, output) diff --git a/railties/test/path_generation_test.rb b/railties/test/path_generation_test.rb index e3dfcdfb7d..d22374a1ff 100644 --- a/railties/test/path_generation_test.rb +++ b/railties/test/path_generation_test.rb @@ -4,18 +4,16 @@ require 'active_support/core_ext/object/json' require 'rails' require 'rails/application' -ROUTING = ActionDispatch::Routing - class PathGenerationTest < ActiveSupport::TestCase attr_reader :app - class TestSet < ROUTING::RouteSet + class TestSet < ActionDispatch::Routing::RouteSet def initialize(block) @block = block super() end - class Dispatcher < ROUTING::RouteSet::Dispatcher + class Dispatcher < ActionDispatch::Routing::RouteSet::Dispatcher def initialize(defaults, set, block) super(defaults) @block = block |