Skip to content
This repository
Browse code

Use Ruby 1.9 Hash syntax in railties

  • Loading branch information...
commit 5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3 1 parent ca618d4
Robin Dupret authored October 14, 2012

Showing 94 changed files with 447 additions and 447 deletions. Show diff stats Hide diff stats

  1. 2  railties/lib/rails.rb
  2. 10  railties/lib/rails/application.rb
  3. 14  railties/lib/rails/application/bootstrap.rb
  4. 6  railties/lib/rails/application/configuration.rb
  5. 4  railties/lib/rails/application/finisher.rb
  6. 2  railties/lib/rails/application/routes_reloader.rb
  7. 2  railties/lib/rails/commands/destroy.rb
  8. 2  railties/lib/rails/commands/generate.rb
  9. 2  railties/lib/rails/commands/runner.rb
  10. 14  railties/lib/rails/commands/server.rb
  11. 2  railties/lib/rails/commands/update.rb
  12. 16  railties/lib/rails/engine.rb
  13. 30  railties/lib/rails/engine/configuration.rb
  14. 58  railties/lib/rails/generators.rb
  15. 44  railties/lib/rails/generators/actions.rb
  16. 16  railties/lib/rails/generators/base.rb
  17. 2  railties/lib/rails/generators/erb/controller/controller_generator.rb
  18. 2  railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb
  19. 8  railties/lib/rails/generators/generated_attribute.rb
  20. 8  railties/lib/rails/generators/named_base.rb
  21. 8  railties/lib/rails/generators/rails/app/app_generator.rb
  22. 8  railties/lib/rails/generators/rails/assets/assets_generator.rb
  23. 4  railties/lib/rails/generators/rails/controller/controller_generator.rb
  24. 6  railties/lib/rails/generators/rails/generator/generator_generator.rb
  25. 2  railties/lib/rails/generators/rails/helper/helper_generator.rb
  26. 2  railties/lib/rails/generators/rails/integration_test/integration_test_generator.rb
  27. 4  railties/lib/rails/generators/rails/migration/migration_generator.rb
  28. 4  railties/lib/rails/generators/rails/model/model_generator.rb
  29. 2  railties/lib/rails/generators/rails/observer/observer_generator.rb
  30. 2  railties/lib/rails/generators/rails/performance_test/performance_test_generator.rb
  31. 32  railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
  32. 2  railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/%name%/application.html.erb.tt
  33. 8  railties/lib/rails/generators/rails/resource/resource_generator.rb
  34. 6  railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb
  35. 12  railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
  36. 2  railties/lib/rails/generators/rails/task/task_generator.rb
  37. 2  railties/lib/rails/generators/rails/task/templates/task.rb
  38. 2  railties/lib/rails/generators/resource_helpers.rb
  39. 4  railties/lib/rails/generators/test_case.rb
  40. 4  railties/lib/rails/generators/test_unit/controller/controller_generator.rb
  41. 2  railties/lib/rails/generators/test_unit/helper/helper_generator.rb
  42. 2  railties/lib/rails/generators/test_unit/integration/integration_generator.rb
  43. 4  railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb
  44. 6  railties/lib/rails/generators/test_unit/model/model_generator.rb
  45. 2  railties/lib/rails/generators/test_unit/observer/observer_generator.rb
  46. 2  railties/lib/rails/generators/test_unit/performance/performance_generator.rb
  47. 4  railties/lib/rails/generators/test_unit/performance/templates/performance_test.rb
  48. 2  railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb
  49. 4  railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
  50. 2  railties/lib/rails/info_controller.rb
  51. 6  railties/lib/rails/paths.rb
  52. 2  railties/lib/rails/railtie.rb
  53. 2  railties/lib/rails/railtie/configurable.rb
  54. 8  railties/lib/rails/railtie/configuration.rb
  55. 2  railties/lib/rails/tasks/annotations.rake
  56. 10  railties/lib/rails/tasks/framework.rake
  57. 2  railties/lib/rails/tasks/middleware.rake
  58. 4  railties/lib/rails/tasks/misc.rake
  59. 2  railties/lib/rails/tasks/routes.rake
  60. 4  railties/lib/rails/tasks/tmp.rake
  61. 4  railties/lib/rails/test_unit/railtie.rb
  62. 28  railties/lib/rails/test_unit/testing.rake
  63. 4  railties/test/application/asset_debugging_test.rb
  64. 6  railties/test/application/assets_test.rb
  65. 30  railties/test/application/configuration_test.rb
  66. 30  railties/test/application/generators_test.rb
  67. 14  railties/test/application/initializers/i18n_test.rb
  68. 2  railties/test/application/initializers/notifications_test.rb
  69. 28  railties/test/application/loading_test.rb
  70. 24  railties/test/application/middleware/cache_test.rb
  71. 2  railties/test/application/middleware/session_test.rb
  72. 8  railties/test/application/middleware_test.rb
  73. 10  railties/test/application/rake_test.rb
  74. 28  railties/test/application/routing_test.rb
  75. 6  railties/test/application/url_generation_test.rb
  76. 8  railties/test/commands/console_test.rb
  77. 2  railties/test/fixtures/lib/plugin_builders/spec_builder.rb
  78. 36  railties/test/generators/actions_test.rb
  79. 6  railties/test/generators/app_generator_test.rb
  80. 6  railties/test/generators/model_generator_test.rb
  81. 6  railties/test/generators/namespaced_generators_test.rb
  82. 4  railties/test/generators/orm_test.rb
  83. 2  railties/test/generators/plugin_new_generator_test.rb
  84. 2  railties/test/generators/resource_generator_test.rb
  85. 2  railties/test/generators/scaffold_generator_test.rb
  86. 14  railties/test/generators/shared_generator_tests.rb
  87. 8  railties/test/generators_test.rb
  88. 18  railties/test/initializable_test.rb
  89. 8  railties/test/isolation/abstract_unit.rb
  90. 28  railties/test/paths_test.rb
  91. 6  railties/test/rails_info_controller_test.rb
  92. 42  railties/test/railties/engine_test.rb
  93. 2  railties/test/railties/generators_test.rb
  94. 38  railties/test/railties/mounted_engine_test.rb
2  railties/lib/rails.rb
@@ -106,7 +106,7 @@ def cache=(cache)
106 106
     # * The environment variable RAILS_GROUPS;
107 107
     # * The optional envs given as argument and the hash with group dependencies;
108 108
     #
109  
-    #   groups :assets => [:development, :test]
  109
+    #   groups assets: [:development, :test]
110 110
     #
111 111
     #   # Returns
112 112
     #   # => [:default, :development, :assets] for Rails.env == "development"
10  railties/lib/rails/application.rb
@@ -71,7 +71,7 @@ def inherited(base)
71 71
     attr_reader :reloaders
72 72
     attr_writer :queue
73 73
 
74  
-    delegate :default_url_options, :default_url_options=, :to => :routes
  74
+    delegate :default_url_options, :default_url_options=, to: :routes
75 75
 
76 76
     def initialize
77 77
       super
@@ -106,7 +106,7 @@ def reload_routes!
106 106
     def key_generator
107 107
       # number of iterations selected based on consultation with the google security
108 108
       # team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220
109  
-      @key_generator ||= ActiveSupport::KeyGenerator.new(config.secret_token, :iterations=>1000)
  109
+      @key_generator ||= ActiveSupport::KeyGenerator.new(config.secret_token, iterations: 1000)
110 110
     end
111 111
 
112 112
     # Stores some of the Rails initial environment parameters which
@@ -296,9 +296,9 @@ def default_middleware_stack #:nodoc:
296 296
 
297 297
           if rack_cache == true
298 298
             rack_cache = {
299  
-              :metastore => "rails:/",
300  
-              :entitystore => "rails:/",
301  
-              :verbose => false
  299
+              metastore: "rails:/",
  300
+              entitystore: "rails:/",
  301
+              verbose: false
302 302
             }
303 303
           end
304 304
 
14  railties/lib/rails/application/bootstrap.rb
@@ -7,13 +7,13 @@ class Application
7 7
     module Bootstrap
8 8
       include Initializable
9 9
 
10  
-      initializer :load_environment_hook, :group => :all do end
  10
+      initializer :load_environment_hook, group: :all do end
11 11
 
12  
-      initializer :load_active_support, :group => :all do
  12
+      initializer :load_active_support, group: :all do
13 13
         require "active_support/all" unless config.active_support.bare
14 14
       end
15 15
 
16  
-      initializer :set_eager_load, :group => :all do
  16
+      initializer :set_eager_load, group: :all do
17 17
         if config.eager_load.nil?
18 18
           warn <<-INFO
19 19
 config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
@@ -28,7 +28,7 @@ module Bootstrap
28 28
       end
29 29
 
30 30
       # Initialize the logger early in the stack in case we need to log some deprecation.
31  
-      initializer :initialize_logger, :group => :all do
  31
+      initializer :initialize_logger, group: :all do
32 32
         Rails.logger ||= config.logger || begin
33 33
           path = config.paths["log"].first
34 34
           unless File.exist? File.dirname path
@@ -56,7 +56,7 @@ module Bootstrap
56 56
       end
57 57
 
58 58
       # Initialize cache early in the stack so railties can make use of it.
59  
-      initializer :initialize_cache, :group => :all do
  59
+      initializer :initialize_cache, group: :all do
60 60
         unless Rails.cache
61 61
           Rails.cache = ActiveSupport::Cache.lookup_store(config.cache_store)
62 62
 
@@ -67,11 +67,11 @@ module Bootstrap
67 67
       end
68 68
 
69 69
       # Sets the dependency loading mechanism.
70  
-      initializer :initialize_dependency_mechanism, :group => :all do
  70
+      initializer :initialize_dependency_mechanism, group: :all do
71 71
         ActiveSupport::Dependencies.mechanism = config.cache_classes ? :require : :load
72 72
       end
73 73
 
74  
-      initializer :bootstrap_hook, :group => :all do |app|
  74
+      initializer :bootstrap_hook, group: :all do |app|
75 75
         ActiveSupport.run_load_hooks(:before_initialize, app)
76 76
       end
77 77
     end
6  railties/lib/rails/application/configuration.rb
@@ -79,10 +79,10 @@ def encoding=(value)
79 79
       def paths
80 80
         @paths ||= begin
81 81
           paths = super
82  
-          paths.add "config/database",    :with => "config/database.yml"
83  
-          paths.add "config/environment", :with => "config/environment.rb"
  82
+          paths.add "config/database",    with: "config/database.yml"
  83
+          paths.add "config/environment", with: "config/environment.rb"
84 84
           paths.add "lib/templates"
85  
-          paths.add "log",                :with => "log/#{Rails.env}.log"
  85
+          paths.add "log",                with: "log/#{Rails.env}.log"
86 86
           paths.add "public"
87 87
           paths.add "public/javascripts"
88 88
           paths.add "public/stylesheets"
4  railties/lib/rails/application/finisher.rb
@@ -72,7 +72,7 @@ module Finisher
72 72
 
73 73
       # Set app reload just after the finisher hook to ensure
74 74
       # paths added in the hook are still loaded.
75  
-      initializer :set_clear_dependencies_hook, :group => :all do
  75
+      initializer :set_clear_dependencies_hook, group: :all do
76 76
         callback = lambda do
77 77
           ActiveSupport::DescendantsTracker.clear
78 78
           ActiveSupport::Dependencies.clear
@@ -83,7 +83,7 @@ module Finisher
83 83
           self.reloaders << reloader
84 84
           # We need to set a to_prepare callback regardless of the reloader result, i.e.
85 85
           # models should be reloaded if any of the reloaders (i18n, routes) were updated.
86  
-          ActionDispatch::Reloader.to_prepare(:prepend => true){ reloader.execute }
  86
+          ActionDispatch::Reloader.to_prepare(prepend: true){ reloader.execute }
87 87
         else
88 88
           ActionDispatch::Reloader.to_cleanup(&callback)
89 89
         end
2  railties/lib/rails/application/routes_reloader.rb
@@ -4,7 +4,7 @@ module Rails
4 4
   class Application
5 5
     class RoutesReloader
6 6
       attr_reader :route_sets, :paths
7  
-      delegate :execute_if_updated, :execute, :updated?, :to => :updater
  7
+      delegate :execute_if_updated, :execute, :updated?, to: :updater
8 8
 
9 9
       def initialize
10 10
         @paths      = []
2  railties/lib/rails/commands/destroy.rb
@@ -6,4 +6,4 @@
6 6
 end
7 7
 
8 8
 name = ARGV.shift
9  
-Rails::Generators.invoke name, ARGV, :behavior => :revoke, :destination_root => Rails.root
  9
+Rails::Generators.invoke name, ARGV, behavior: :revoke, destination_root: Rails.root
2  railties/lib/rails/commands/generate.rb
@@ -8,4 +8,4 @@
8 8
 name = ARGV.shift
9 9
 
10 10
 root = defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root
11  
-Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => root
  11
+Rails::Generators.invoke name, ARGV, behavior: :invoke, destination_root: root
2  railties/lib/rails/commands/runner.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require 'optparse'
2 2
 require 'rbconfig'
3 3
 
4  
-options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
  4
+options = { environment: (ENV['RAILS_ENV'] || "development").dup }
5 5
 code_or_file = nil
6 6
 
7 7
 if ARGV.first.nil?
14  railties/lib/rails/commands/server.rb
@@ -105,13 +105,13 @@ def log_path
105 105
 
106 106
     def default_options
107 107
       super.merge({
108  
-        :Port        => 3000,
109  
-        :DoNotReverseLookup => true,
110  
-        :environment => (ENV['RAILS_ENV'] || "development").dup,
111  
-        :daemonize   => false,
112  
-        :debugger    => false,
113  
-        :pid         => File.expand_path("tmp/pids/server.pid"),
114  
-        :config      => File.expand_path("config.ru")
  108
+        Port:         3000,
  109
+        DoNotReverseLookup:  true,
  110
+        environment:  (ENV['RAILS_ENV'] || "development").dup,
  111
+        daemonize:    false,
  112
+        debugger:     false,
  113
+        pid:          File.expand_path("tmp/pids/server.pid"),
  114
+        config:       File.expand_path("config.ru")
115 115
       })
116 116
     end
117 117
   end
2  railties/lib/rails/commands/update.rb
@@ -6,4 +6,4 @@
6 6
 end
7 7
 
8 8
 name = ARGV.shift
9  
-Rails::Generators.invoke name, ARGV, :behavior => :skip
  9
+Rails::Generators.invoke name, ARGV, behavior: :skip
16  railties/lib/rails/engine.rb
@@ -251,7 +251,7 @@ module Rails
251 251
   #
252 252
   #   # config/routes.rb
253 253
   #   MyApplication::Application.routes.draw do
254  
-  #     mount MyEngine::Engine => "/my_engine", :as => "my_engine"
  254
+  #     mount MyEngine::Engine => "/my_engine", as: "my_engine"
255 255
   #     get "/foo" => "foo#index"
256 256
   #   end
257 257
   #
@@ -368,7 +368,7 @@ def endpoint(endpoint = nil)
368 368
       def isolate_namespace(mod)
369 369
         engine_name(generate_railtie_name(mod))
370 370
 
371  
-        self.routes.default_scope = { :module => ActiveSupport::Inflector.underscore(mod.name) }
  371
+        self.routes.default_scope = { module: ActiveSupport::Inflector.underscore(mod.name) }
372 372
         self.isolated = true
373 373
 
374 374
         unless mod.respond_to?(:railtie_namespace)
@@ -407,8 +407,8 @@ def find(path)
407 407
       end
408 408
     end
409 409
 
410  
-    delegate :middleware, :root, :paths, :to => :config
411  
-    delegate :engine_name, :isolated?, :to => "self.class"
  410
+    delegate :middleware, :root, :paths, to: :config
  411
+    delegate :engine_name, :isolated?, to: "self.class"
412 412
 
413 413
     def initialize
414 414
       @_all_autoload_paths = nil
@@ -536,7 +536,7 @@ def load_seed
536 536
     end
537 537
 
538 538
     # Add configured load paths to ruby load paths and remove duplicates.
539  
-    initializer :set_load_path, :before => :bootstrap_hook do
  539
+    initializer :set_load_path, before: :bootstrap_hook do
540 540
       _all_load_paths.reverse_each do |path|
541 541
         $LOAD_PATH.unshift(path) if File.directory?(path)
542 542
       end
@@ -548,7 +548,7 @@ def load_seed
548 548
     #
549 549
     # This needs to be an initializer, since it needs to run once
550 550
     # per engine and get the engine as a block parameter
551  
-    initializer :set_autoload_paths, :before => :bootstrap_hook do |app|
  551
+    initializer :set_autoload_paths, before: :bootstrap_hook do |app|
552 552
       ActiveSupport::Dependencies.autoload_paths.unshift(*_all_autoload_paths)
553 553
       ActiveSupport::Dependencies.autoload_once_paths.unshift(*_all_autoload_once_paths)
554 554
 
@@ -581,13 +581,13 @@ def load_seed
581 581
       end
582 582
     end
583 583
 
584  
-    initializer :load_environment_config, :before => :load_environment_hook, :group => :all do
  584
+    initializer :load_environment_config, before: :load_environment_hook, group: :all do
585 585
       paths["config/environments"].existent.each do |environment|
586 586
         require environment
587 587
       end
588 588
     end
589 589
 
590  
-    initializer :append_assets_path, :group => :all do |app|
  590
+    initializer :append_assets_path, group: :all do |app|
591 591
       app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
592 592
       app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
593 593
       app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
30  railties/lib/rails/engine/configuration.rb
@@ -20,7 +20,7 @@ def middleware
20 20
       # Holds generators configuration:
21 21
       #
22 22
       #   config.generators do |g|
23  
-      #     g.orm             :data_mapper, :migration => true
  23
+      #     g.orm             :data_mapper, migration: true
24 24
       #     g.template_engine :haml
25 25
       #     g.test_framework  :rspec
26 26
       #   end
@@ -38,26 +38,26 @@ def generators #:nodoc:
38 38
       def paths
39 39
         @paths ||= begin
40 40
           paths = Rails::Paths::Root.new(@root)
41  
-          paths.add "app",                 :eager_load => true, :glob => "*"
42  
-          paths.add "app/assets",          :glob => "*"
43  
-          paths.add "app/controllers",     :eager_load => true
44  
-          paths.add "app/helpers",         :eager_load => true
45  
-          paths.add "app/models",          :eager_load => true
46  
-          paths.add "app/mailers",         :eager_load => true
  41
+          paths.add "app",                 eager_load: true, glob: "*"
  42
+          paths.add "app/assets",          glob: "*"
  43
+          paths.add "app/controllers",     eager_load: true
  44
+          paths.add "app/helpers",         eager_load: true
  45
+          paths.add "app/models",          eager_load: true
  46
+          paths.add "app/mailers",         eager_load: true
47 47
           paths.add "app/views"
48  
-          paths.add "lib",                 :load_path => true
49  
-          paths.add "lib/assets",          :glob => "*"
50  
-          paths.add "lib/tasks",           :glob => "**/*.rake"
  48
+          paths.add "lib",                 load_path: true
  49
+          paths.add "lib/assets",          glob: "*"
  50
+          paths.add "lib/tasks",           glob: "**/*.rake"
51 51
           paths.add "config"
52  
-          paths.add "config/environments", :glob => "#{Rails.env}.rb"
53  
-          paths.add "config/initializers", :glob => "**/*.rb"
54  
-          paths.add "config/locales",      :glob => "*.{rb,yml}"
  52
+          paths.add "config/environments", glob: "#{Rails.env}.rb"
  53
+          paths.add "config/initializers", glob: "**/*.rb"
  54
+          paths.add "config/locales",      glob: "*.{rb,yml}"
55 55
           paths.add "config/routes.rb"
56 56
           paths.add "db"
57 57
           paths.add "db/migrate"
58 58
           paths.add "db/seeds.rb"
59  
-          paths.add "vendor",              :load_path => true
60  
-          paths.add "vendor/assets",       :glob => "*"
  59
+          paths.add "vendor",              load_path: true
  60
+          paths.add "vendor/assets",       glob: "*"
61 61
           paths
62 62
         end
63 63
       end
58  railties/lib/rails/generators.rb
@@ -23,41 +23,41 @@ module Generators
23 23
     mattr_accessor :namespace
24 24
 
25 25
     DEFAULT_ALIASES = {
26  
-      :rails => {
27  
-        :actions => '-a',
28  
-        :orm => '-o',
29  
-        :javascripts => '-j',
30  
-        :javascript_engine => '-je',
31  
-        :resource_controller => '-c',
32  
-        :scaffold_controller => '-c',
33  
-        :stylesheets => '-y',
34  
-        :stylesheet_engine => '-se',
35  
-        :template_engine => '-e',
36  
-        :test_framework => '-t'
  26
+      rails: {
  27
+        actions: '-a',
  28
+        orm: '-o',
  29
+        javascripts: '-j',
  30
+        javascript_engine: '-je',
  31
+        resource_controller: '-c',
  32
+        scaffold_controller: '-c',
  33
+        stylesheets: '-y',
  34
+        stylesheet_engine: '-se',
  35
+        template_engine: '-e',
  36
+        test_framework: '-t'
37 37
       },
38 38
 
39  
-      :test_unit => {
40  
-        :fixture_replacement => '-r',
  39
+      test_unit: {
  40
+        fixture_replacement: '-r',
41 41
       }
42 42
     }
43 43
 
44 44
     DEFAULT_OPTIONS = {
45  
-      :rails => {
46  
-        :assets => true,
47  
-        :force_plural => false,
48  
-        :helper => true,
49  
-        :integration_tool => nil,
50  
-        :javascripts => true,
51  
-        :javascript_engine => :js,
52  
-        :orm => false,
53  
-        :performance_tool => nil,
54  
-        :resource_controller => :controller,
55  
-        :resource_route => true,
56  
-        :scaffold_controller => :scaffold_controller,
57  
-        :stylesheets => true,
58  
-        :stylesheet_engine => :css,
59  
-        :test_framework => false,
60  
-        :template_engine => :erb
  45
+      rails: {
  46
+        assets: true,
  47
+        force_plural: false,
  48
+        helper: true,
  49
+        integration_tool: nil,
  50
+        javascripts: true,
  51
+        javascript_engine: :js,
  52
+        orm: false,
  53
+        performance_tool: nil,
  54
+        resource_controller: :controller,
  55
+        resource_route: true,
  56
+        scaffold_controller: :scaffold_controller,
  57
+        stylesheets: true,
  58
+        stylesheet_engine: :css,
  59
+        test_framework: false,
  60
+        template_engine: :erb
61 61
       }
62 62
     }
63 63
 
44  railties/lib/rails/generators/actions.rb
@@ -7,9 +7,9 @@ module Actions
7 7
 
8 8
       # Adds an entry into Gemfile for the supplied gem.
9 9
       #
10  
-      #   gem "rspec", :group => :test
11  
-      #   gem "technoweenie-restful-authentication", :lib => "restful-authentication", :source => "http://gems.github.com/"
12  
-      #   gem "rails", "3.0", :git => "git://github.com/rails/rails"
  10
+      #   gem "rspec", group: :test
  11
+      #   gem "technoweenie-restful-authentication", lib: "restful-authentication", source: "http://gems.github.com/"
  12
+      #   gem "rails", "3.0", git: "git://github.com/rails/rails"
13 13
       def gem(*args)
14 14
         options = args.extract_options!
15 15
         name, version = args
@@ -33,7 +33,7 @@ def gem(*args)
33 33
           str = "gem #{parts.join(", ")}"
34 34
           str = "  " + str if @in_group
35 35
           str = "\n" + str
36  
-          append_file "Gemfile", str, :verbose => false
  36
+          append_file "Gemfile", str, verbose: false
37 37
         end
38 38
       end
39 39
 
@@ -47,13 +47,13 @@ def gem_group(*names, &block)
47 47
         log :gemfile, "group #{name}"
48 48
 
49 49
         in_root do
50  
-          append_file "Gemfile", "\ngroup #{name} do", :force => true
  50
+          append_file "Gemfile", "\ngroup #{name} do", force: true
51 51
 
52 52
           @in_group = true
53 53
           instance_eval(&block)
54 54
           @in_group = false
55 55
 
56  
-          append_file "Gemfile", "\nend\n", :force => true
  56
+          append_file "Gemfile", "\nend\n", force: true
57 57
         end
58 58
       end
59 59
 
@@ -64,7 +64,7 @@ def add_source(source, options={})
64 64
         log :source, source
65 65
 
66 66
         in_root do
67  
-          prepend_file "Gemfile", "source #{source.inspect}\n", :verbose => false
  67
+          prepend_file "Gemfile", "source #{source.inspect}\n", verbose: false
68 68
         end
69 69
       end
70 70
 
@@ -77,7 +77,7 @@ def add_source(source, options={})
77 77
       #     "config.autoload_paths += %W(#{config.root}/extras)"
78 78
       #   end
79 79
       #
80  
-      #   environment(nil, :env => "development") do
  80
+      #   environment(nil, env: "development") do
81 81
       #     "config.active_record.observers = :cacher"
82 82
       #   end
83 83
       def environment(data=nil, options={}, &block)
@@ -87,10 +87,10 @@ def environment(data=nil, options={}, &block)
87 87
 
88 88
         in_root do
89 89
           if options[:env].nil?
90  
-            inject_into_file 'config/application.rb', "\n    #{data}", :after => sentinel, :verbose => false
  90
+            inject_into_file 'config/application.rb', "\n    #{data}", after: sentinel, verbose: false
91 91
           else
92 92
             Array(options[:env]).each do |env|
93  
-              inject_into_file "config/environments/#{env}.rb", "\n  #{data}", :after => env_file_sentinel, :verbose => false
  93
+              inject_into_file "config/environments/#{env}.rb", "\n  #{data}", after: env_file_sentinel, verbose: false
94 94
             end
95 95
           end
96 96
         end
@@ -100,8 +100,8 @@ def environment(data=nil, options={}, &block)
100 100
       # Run a command in git.
101 101
       #
102 102
       #   git :init
103  
-      #   git :add => "this.file that.rb"
104  
-      #   git :add => "onefile.rb", :rm => "badfile.cxx"
  103
+      #   git add: "this.file that.rb"
  104
+      #   git add: "onefile.rb", rm: "badfile.cxx"
105 105
       def git(commands={})
106 106
         if commands.is_a?(Symbol)
107 107
           run "git #{commands}"
@@ -123,7 +123,7 @@ def git(commands={})
123 123
       #   vendor("foreign.rb", "# Foreign code is fun")
124 124
       def vendor(filename, data=nil, &block)
125 125
         log :vendor, filename
126  
-        create_file("vendor/#{filename}", data, :verbose => false, &block)
  126
+        create_file("vendor/#{filename}", data, verbose: false, &block)
127 127
       end
128 128
 
129 129
       # Create a new file in the lib/ directory. Code can be specified
@@ -136,7 +136,7 @@ def vendor(filename, data=nil, &block)
136 136
       #   lib("foreign.rb", "# Foreign code is fun")
137 137
       def lib(filename, data=nil, &block)
138 138
         log :lib, filename
139  
-        create_file("lib/#{filename}", data, :verbose => false, &block)
  139
+        create_file("lib/#{filename}", data, verbose: false, &block)
140 140
       end
141 141
 
142 142
       # Create a new Rakefile with the provided code (either in a block or a string).
@@ -156,7 +156,7 @@ def lib(filename, data=nil, &block)
156 156
       #   rakefile('seed.rake', 'puts "Planting seeds"')
157 157
       def rakefile(filename, data=nil, &block)
158 158
         log :rakefile, filename
159  
-        create_file("lib/tasks/#{filename}", data, :verbose => false, &block)
  159
+        create_file("lib/tasks/#{filename}", data, verbose: false, &block)
160 160
       end
161 161
 
162 162
       # Create a new initializer with the provided code (either in a block or a string).
@@ -174,7 +174,7 @@ def rakefile(filename, data=nil, &block)
174 174
       #   initializer("api.rb", "API_KEY = '123456'")
175 175
       def initializer(filename, data=nil, &block)
176 176
         log :initializer, filename
177  
-        create_file("config/initializers/#{filename}", data, :verbose => false, &block)
  177
+        create_file("config/initializers/#{filename}", data, verbose: false, &block)
178 178
       end
179 179
 
180 180
       # Generate something using a generator from Rails or a plugin.
@@ -186,19 +186,19 @@ def generate(what, *args)
186 186
         log :generate, what
187 187
         argument = args.map {|arg| arg.to_s }.flatten.join(" ")
188 188
 
189  
-        in_root { run_ruby_script("script/rails generate #{what} #{argument}", :verbose => false) }
  189
+        in_root { run_ruby_script("script/rails generate #{what} #{argument}", verbose: false) }
190 190
       end
191 191
 
192 192
       # Runs the supplied rake task
193 193
       #
194 194
       #   rake("db:migrate")
195  
-      #   rake("db:migrate", :env => "production")
196  
-      #   rake("gems:install", :sudo => true)
  195
+      #   rake("db:migrate", env: "production")
  196
+      #   rake("gems:install", sudo: true)
197 197
       def rake(command, options={})
198 198
         log :rake, command
199 199
         env  = options[:env] || ENV["RAILS_ENV"] || 'development'
200 200
         sudo = options[:sudo] && RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ ? 'sudo ' : ''
201  
-        in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", :verbose => false) }
  201
+        in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", verbose: false) }
202 202
       end
203 203
 
204 204
       # Just run the capify command in root
@@ -206,7 +206,7 @@ def rake(command, options={})
206 206
       #   capify!
207 207
       def capify!
208 208
         log :capify, ""
209  
-        in_root { run("#{extify(:capify)} .", :verbose => false) }
  209
+        in_root { run("#{extify(:capify)} .", verbose: false) }
210 210
       end
211 211
 
212 212
       # Make an entry in Rails routing file config/routes.rb
@@ -217,7 +217,7 @@ def route(routing_code)
217 217
         sentinel = /\.routes\.draw do\s*$/
218 218
 
219 219
         in_root do
220  
-          inject_into_file 'config/routes.rb', "\n  #{routing_code}", { :after => sentinel, :verbose => false }
  220
+          inject_into_file 'config/routes.rb', "\n  #{routing_code}", { after: sentinel, verbose: false }
221 221
         end
222 222
       end
223 223
 
16  railties/lib/rails/generators/base.rb
@@ -61,7 +61,7 @@ def self.hide!
61 61
       #
62 62
       #   module Rails::Generators
63 63
       #     class ControllerGenerator < Base
64  
-      #       hook_for :test_framework, :aliases => "-t"
  64
+      #       hook_for :test_framework, aliases: "-t"
65 65
       #     end
66 66
       #   end
67 67
       #
@@ -102,7 +102,7 @@ def self.hide!
102 102
       # :as option:
103 103
       #
104 104
       #   class AwesomeGenerator < Rails::Generators::Base
105  
-      #     hook_for :test_framework, :as => :controller
  105
+      #     hook_for :test_framework, as: :controller
106 106
       #   end
107 107
       #
108 108
       # And now it will lookup at:
@@ -113,7 +113,7 @@ def self.hide!
113 113
       # need to provide the :base value:
114 114
       #
115 115
       #   class AwesomeGenerator < Rails::Generators::Base
116  
-      #     hook_for :test_framework, :in => :rails, :as => :controller
  116
+      #     hook_for :test_framework, in: :rails, as: :controller
117 117
       #   end
118 118
       #
119 119
       # And the lookup is exactly the same as previously:
@@ -137,7 +137,7 @@ def self.hide!
137 137
       # developers might want to have webrat available on controller generator.
138 138
       # This can be achieved as:
139 139
       #
140  
-      #   Rails::Generators::ControllerGenerator.hook_for :webrat, :type => :boolean
  140
+      #   Rails::Generators::ControllerGenerator.hook_for :webrat, type: :boolean
141 141
       #
142 142
       # Then, if you want webrat to be invoked, just supply:
143 143
       #
@@ -171,9 +171,9 @@ def self.hook_for(*names, &block)
171 171
           defaults = if options[:type] == :boolean
172 172
             { }
173 173
           elsif [true, false].include?(default_value_for_option(name, options))
174  
-            { :banner => "" }
  174
+            { banner: "" }
175 175
           else
176  
-            { :desc => "#{name.to_s.humanize} to be invoked", :banner => "NAME" }
  176
+            { desc: "#{name.to_s.humanize} to be invoked", banner: "NAME" }
177 177
           end
178 178
 
179 179
           unless class_options.key?(name)
@@ -343,8 +343,8 @@ def self.prepare_for_invocation(name, value) #:nodoc:
343 343
         # Small macro to add ruby as an option to the generator with proper
344 344
         # default value plus an instance helper method called shebang.
345 345
         def self.add_shebang_option!
346  
-          class_option :ruby, :type => :string, :aliases => "-r", :default => Thor::Util.ruby_command,
347  
-                              :desc => "Path to the Ruby binary of your choice", :banner => "PATH"
  346
+          class_option :ruby, type: :string, aliases: "-r", default: Thor::Util.ruby_command,
  347
+                              desc: "Path to the Ruby binary of your choice", banner: "PATH"
348 348
 
349 349
           no_tasks {
350 350
             define_method :shebang do
2  railties/lib/rails/generators/erb/controller/controller_generator.rb
@@ -3,7 +3,7 @@
3 3
 module Erb # :nodoc:
4 4
   module Generators # :nodoc:
5 5
     class ControllerGenerator < Base # :nodoc:
6  
-      argument :actions, :type => :array, :default => [], :banner => "action action"
  6
+      argument :actions, type: :array, default: [], banner: "action action"
7 7
 
8 8
       def copy_view_files
9 9
         base_path = File.join("app/views", class_path, file_name)
2  railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb
@@ -6,7 +6,7 @@ module Generators # :nodoc:
6 6
     class ScaffoldGenerator < Base # :nodoc:
7 7
       include Rails::Generators::ResourceHelpers
8 8
 
9  
-      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
  9
+      argument :attributes, type: :array, default: [], banner: "field:type field:type"
10 10
 
11 11
       def create_root_folder
12 12
         empty_directory File.join("app/views", controller_file_path)
8  railties/lib/rails/generators/generated_attribute.rb
@@ -23,7 +23,7 @@ def parse(column_definition)
23 23
           type = type.to_sym if type
24 24
 
25 25
           if type && reference?(type)
26  
-            references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { :unique => true } : true
  26
+            references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { unique: true } : true
27 27
             attr_options[:index] = references_index
28 28
           end
29 29
 
@@ -41,11 +41,11 @@ def reference?(type)
41 41
         def parse_type_and_options(type)
42 42
           case type
43 43
           when /(string|text|binary|integer)\{(\d+)\}/
44  
-            return $1, :limit => $2.to_i
  44
+            return $1, limit: $2.to_i
45 45
           when /decimal\{(\d+)[,.-](\d+)\}/
46  
-            return :decimal, :precision => $1.to_i, :scale => $2.to_i
  46
+            return :decimal, precision: $1.to_i, scale: $2.to_i
47 47
           when /(references|belongs_to)\{polymorphic\}/
48  
-            return $1, :polymorphic => true
  48
+            return $1, polymorphic: true
49 49
           else
50 50
             return type, {}
51 51
           end
8  railties/lib/rails/generators/named_base.rb
@@ -5,9 +5,9 @@
5 5
 module Rails
6 6
   module Generators
7 7
     class NamedBase < Base
8  
-      argument :name, :type => :string
9  
-      class_option :skip_namespace, :type => :boolean, :default => false,
10  
-                                    :desc => "Skip namespace (affects only isolated applications)"
  8
+      argument :name, type: :string
  9
+      class_option :skip_namespace, type: :boolean, default: false,
  10
+                                    desc: "Skip namespace (affects only isolated applications)"
11 11
 
12 12
       def initialize(args, *options) #:nodoc:
13 13
         @inside_template = nil
@@ -169,7 +169,7 @@ def pluralize_table_names?
169 169
         #
170 170
         # ==== Examples
171 171
         #
172  
-        #   check_class_collision :suffix => "Observer"
  172
+        #   check_class_collision suffix: "Observer"
173 173
         #
174 174
         # If the generator is invoked with class name Admin, it will check for
175 175
         # the presence of "AdminObserver".
8  railties/lib/rails/generators/rails/app/app_generator.rb
@@ -96,7 +96,7 @@ def log
96 96
     end
97 97
 
98 98
     def public_directory
99  
-      directory "public", "public", :recursive => false
  99
+      directory "public", "public", recursive: false
100 100
       if options[:skip_index_html]
101 101
         remove_file "public/index.html"
102 102
         remove_file 'app/assets/images/rails.png'
@@ -108,7 +108,7 @@ def script
108 108
       directory "script" do |content|
109 109
         "#{shebang}\n" + content
110 110
       end
111  
-      chmod "script", 0755, :verbose => false
  111
+      chmod "script", 0755, verbose: false
112 112
     end
113 113
 
114 114
     def test
@@ -152,8 +152,8 @@ class AppGenerator < AppBase # :nodoc:
152 152
       add_shared_options_for "application"
153 153
 
154 154
       # Add bin/rails options
155  
-      class_option :version, :type => :boolean, :aliases => "-v", :group => :rails,
156  
-                             :desc => "Show Rails version number and quit"
  155
+      class_option :version, type: :boolean, aliases: "-v", group: :rails,
  156
+                             desc: "Show Rails version number and quit"
157 157
 
158 158
       def initialize(*args)
159 159
         raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank?
8  railties/lib/rails/generators/rails/assets/assets_generator.rb
... ...
@@ -1,11 +1,11 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class AssetsGenerator < NamedBase # :nodoc:
4  
-      class_option :javascripts, :type => :boolean, :desc => "Generate JavaScripts"
5  
-      class_option :stylesheets, :type => :boolean, :desc => "Generate Stylesheets"
  4
+      class_option :javascripts, type: :boolean, desc: "Generate JavaScripts"
  5
+      class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
6 6
 
7  
-      class_option :javascript_engine, :desc => "Engine for JavaScripts"
8  
-      class_option :stylesheet_engine, :desc => "Engine for Stylesheets"
  7
+      class_option :javascript_engine, desc: "Engine for JavaScripts"
  8
+      class_option :stylesheet_engine, desc: "Engine for Stylesheets"
9 9
 
10 10
       protected
11 11
 
4  railties/lib/rails/generators/rails/controller/controller_generator.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class ControllerGenerator < NamedBase # :nodoc:
4  
-      argument :actions, :type => :array, :default => [], :banner => "action action"
5  
-      check_class_collision :suffix => "Controller"
  4
+      argument :actions, type: :array, default: [], banner: "action action"
  5
+      check_class_collision suffix: "Controller"
6 6
 
7 7
       def create_controller_files
8 8
         template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb")
6  railties/lib/rails/generators/rails/generator/generator_generator.rb
... ...
@@ -1,10 +1,10 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class GeneratorGenerator < NamedBase # :nodoc:
4  
-      check_class_collision :suffix => "Generator"
  4
+      check_class_collision suffix: "Generator"
5 5
 
6  
-      class_option :namespace, :type => :boolean, :default => true,
7  
-                               :desc => "Namespace generator under lib/generators/name"
  6
+      class_option :namespace, type: :boolean, default: true,
  7
+                               desc: "Namespace generator under lib/generators/name"
8 8
 
9 9
       def create_generator_files
10 10
         directory '.', generator_dir
2  railties/lib/rails/generators/rails/helper/helper_generator.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class HelperGenerator < NamedBase # :nodoc:
4  
-      check_class_collision :suffix => "Helper"
  4
+      check_class_collision suffix: "Helper"
5 5
 
6 6
       def create_helper_files
7 7
         template 'helper.rb', File.join('app/helpers', class_path, "#{file_name}_helper.rb")
2  railties/lib/rails/generators/rails/integration_test/integration_test_generator.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class IntegrationTestGenerator < NamedBase # :nodoc:
4  
-      hook_for :integration_tool, :as => :integration
  4
+      hook_for :integration_tool, as: :integration
5 5
     end
6 6
   end
7 7
 end
4  railties/lib/rails/generators/rails/migration/migration_generator.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class MigrationGenerator < NamedBase # :nodoc:
4  
-      argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
5  
-      hook_for :orm, :required => true
  4
+      argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
  5
+      hook_for :orm, required: true
6 6
     end
7 7
   end
8 8
 end
4  railties/lib/rails/generators/rails/model/model_generator.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class ModelGenerator < NamedBase # :nodoc:
4  
-      argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
5  
-      hook_for :orm, :required => true
  4
+      argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
  5
+      hook_for :orm, required: true
6 6
     end
7 7
   end
8 8
 end
2  railties/lib/rails/generators/rails/observer/observer_generator.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class ObserverGenerator < NamedBase # :nodoc:
4  
-      hook_for :orm, :required => true
  4
+      hook_for :orm, required: true
5 5
     end
6 6
   end
7 7
 end
2  railties/lib/rails/generators/rails/performance_test/performance_test_generator.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class PerformanceTestGenerator < NamedBase # :nodoc:
4  
-      hook_for :performance_tool, :as => :performance
  4
+      hook_for :performance_tool, as: :performance
5 5
     end
6 6
   end
7 7
 end
32  railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -68,7 +68,7 @@ def test
68 68
       append_file "Rakefile", <<-EOF
69 69
 #{rakefile_test_tasks}
70 70
 
71  
-task :default => :test
  71
+task default: :test
72 72
       EOF
73 73
       if full?
74 74
         template "test/integration/navigation_test.rb"
@@ -89,10 +89,10 @@ def generate_test_dummy(force = false)
89 89
     end
90 90
 
91 91
     def test_dummy_config
92  
-      template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true
93  
-      template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true
  92
+      template "rails/boot.rb", "#{dummy_path}/config/boot.rb", force: true
  93
+      template "rails/application.rb", "#{dummy_path}/config/application.rb", force: true
94 94
       if mountable?
95  
-        template "rails/routes.rb", "#{dummy_path}/config/routes.rb", :force => true
  95
+        template "rails/routes.rb", "#{dummy_path}/config/routes.rb", force: true
96 96
       end
97 97
     end
98 98
 
@@ -135,10 +135,10 @@ def javascripts
135 135
     def script(force = false)
136 136
       return unless full?
137 137
 
138  
-      directory "script", :force => force do |content|
  138
+      directory "script", force: force do |content|
139 139
         "#{shebang}\n" + content
140 140
       end
141  
-      chmod "script", 0755, :verbose => false
  141
+      chmod "script", 0755, verbose: false
142 142
     end
143 143
 
144 144
     def gemfile_entry
@@ -158,20 +158,20 @@ class PluginNewGenerator < AppBase # :nodoc:
158 158
 
159 159
       alias_method :plugin_path, :app_path
160 160
 
161  
-      class_option :dummy_path,   :type => :string, :default => "test/dummy",
162  
-                                  :desc => "Create dummy application at given path"
  161
+      class_option :dummy_path,   type: :string, default: "test/dummy",
  162
+                                  desc: "Create dummy application at given path"
163 163
 
164  
-      class_option :full,         :type => :boolean, :default => false,
165  
-                                  :desc => "Generate a rails engine with bundled Rails application for testing"
  164
+      class_option :full,         type: :boolean, default: false,
  165
+                                  desc: "Generate a rails engine with bundled Rails application for testing"
166 166
 
167  
-      class_option :mountable,    :type => :boolean, :default => false,
168  
-                                  :desc => "Generate mountable isolated application"
  167
+      class_option :mountable,    type: :boolean, default: false,
  168
+                                  desc: "Generate mountable isolated application"
169 169
 
170  
-      class_option :skip_gemspec, :type => :boolean, :default => false,
171  
-                                  :desc => "Skip gemspec file"
  170
+      class_option :skip_gemspec, type: :boolean, default: false,
  171
+                                  desc: "Skip gemspec file"
172 172
 
173  
-      class_option :skip_gemfile_entry, :type => :boolean, :default => false,
174  
-                                        :desc => "If creating plugin in application's directory " +
  173
+      class_option :skip_gemfile_entry, type: :boolean, default: false,
  174
+                                        desc: "If creating plugin in application's directory " +
175 175
                                                  "skip adding entry to Gemfile"
176 176
 
177 177
       def initialize(*args)
2  railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/%name%/application.html.erb.tt
@@ -2,7 +2,7 @@
2 2
 <html>
3 3
 <head>
4 4
   <title><%= camelized %></title>
5  
-  <%%= stylesheet_link_tag    "<%= name %>/application", :media => "all" %>
  5
+  <%%= stylesheet_link_tag    "<%= name %>/application", media: "all" %>
6 6
   <%%= javascript_include_tag "<%= name %>/application" %>
7 7
   <%%= csrf_meta_tags %>
8 8
 </head>
8  railties/lib/rails/generators/rails/resource/resource_generator.rb
@@ -7,14 +7,14 @@ module Generators
7 7
     class ResourceGenerator < ModelGenerator # :nodoc:
8 8
       include ResourceHelpers
9 9
 
10  
-      hook_for :resource_controller, :required => true do |controller|
  10
+      hook_for :resource_controller, required: true do |controller|
11 11
         invoke controller, [ controller_name, options[:actions] ]
12 12
       end
13 13
 
14  
-      class_option :actions, :type => :array, :banner => "ACTION ACTION", :default => [],
15  
-                             :desc => "Actions for the resource controller"
  14
+      class_option :actions, type: :array, banner: "ACTION ACTION", default: [],
  15
+                             desc: "Actions for the resource controller"
16 16
 
17  
-      hook_for :resource_route, :required => true
  17
+      hook_for :resource_route, required: true
18 18
     end
19 19
   end
20 20
 end
6  railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb
@@ -6,10 +6,10 @@ class ScaffoldGenerator < ResourceGenerator # :nodoc:
6 6
       remove_hook_for :resource_controller
7 7
       remove_class_option :actions
8 8
 
9  
-      class_option :stylesheets, :type => :boolean, :desc => "Generate Stylesheets"
10  
-      class_option :stylesheet_engine, :desc => "Engine for Stylesheets"
  9
+      class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
  10
+      class_option :stylesheet_engine, desc: "Engine for Stylesheets"
11 11
 
12  
-      hook_for :scaffold_controller, :required => true
  12
+      hook_for :scaffold_controller, required: true
13 13
 
14 14
       hook_for :assets do |assets|
15 15
         invoke assets, [controller_name]
12  railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
@@ -5,21 +5,21 @@ module Generators
5 5
     class ScaffoldControllerGenerator < NamedBase # :nodoc:
6 6
       include ResourceHelpers
7 7
 
8  
-      check_class_collision :suffix => "Controller"
  8
+      check_class_collision suffix: "Controller"
9 9
 
10  
-      class_option :orm, :banner => "NAME", :type => :string, :required => true,
11  
-                         :desc => "ORM to generate the controller for"
  10
+      class_option :orm, banner: "NAME", type: :string, required: true,
  11
+                         desc: "ORM to generate the controller for"
12 12
 
13  
-      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
  13
+      argument :attributes, type: :array, default: [], banner: "field:type field:type"
14 14
 
15 15
       def create_controller_files
16 16
         template "controller.rb", File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
17 17
       end
18 18
 
19  
-      hook_for :template_engine, :test_framework, :as => :scaffold
  19
+      hook_for :template_engine, :test_framework, as: :scaffold
20 20
 
21 21
       # Invoke the helper using the controller name (pluralized)
22  
-      hook_for :helper, :as => :scaffold do |invoked|
  22
+      hook_for :helper, as: :scaffold do |invoked|
23 23
         invoke invoked, [ controller_name ]
24 24
       end
25 25
     end
2  railties/lib/rails/generators/rails/task/task_generator.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Rails
2 2
   module Generators
3 3
     class TaskGenerator < NamedBase # :nodoc:
4  
-      argument :actions, :type => :array, :default => [], :banner => "action action"
  4
+      argument :actions, type: :array, default: [], banner: "action action"
5 5
 
6 6
       def create_task_files
7 7
         template 'task.rb', File.join('lib/tasks', "#{file_name}.rake")