aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/base.rb
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2012-10-14 12:03:39 +0200
committerRobin Dupret <robin.dupret@gmail.com>2012-10-14 18:26:58 +0200
commit5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3 (patch)
tree9e58227af8a363398a03b8010156d5a84d59dea9 /railties/lib/rails/generators/base.rb
parentca618d473dcb9b5cc4000d057df9322376900622 (diff)
downloadrails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.gz
rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.bz2
rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.zip
Use Ruby 1.9 Hash syntax in railties
Diffstat (limited to 'railties/lib/rails/generators/base.rb')
-rw-r--r--railties/lib/rails/generators/base.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index 5ca1bfc20f..7e938fab47 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -61,7 +61,7 @@ module Rails
#
# module Rails::Generators
# class ControllerGenerator < Base
- # hook_for :test_framework, :aliases => "-t"
+ # hook_for :test_framework, aliases: "-t"
# end
# end
#
@@ -102,7 +102,7 @@ module Rails
# :as option:
#
# class AwesomeGenerator < Rails::Generators::Base
- # hook_for :test_framework, :as => :controller
+ # hook_for :test_framework, as: :controller
# end
#
# And now it will lookup at:
@@ -113,7 +113,7 @@ module Rails
# need to provide the :base value:
#
# class AwesomeGenerator < Rails::Generators::Base
- # hook_for :test_framework, :in => :rails, :as => :controller
+ # hook_for :test_framework, in: :rails, as: :controller
# end
#
# And the lookup is exactly the same as previously:
@@ -137,7 +137,7 @@ module Rails
# developers might want to have webrat available on controller generator.
# This can be achieved as:
#
- # Rails::Generators::ControllerGenerator.hook_for :webrat, :type => :boolean
+ # Rails::Generators::ControllerGenerator.hook_for :webrat, type: :boolean
#
# Then, if you want webrat to be invoked, just supply:
#
@@ -171,9 +171,9 @@ module Rails
defaults = if options[:type] == :boolean
{ }
elsif [true, false].include?(default_value_for_option(name, options))
- { :banner => "" }
+ { banner: "" }
else
- { :desc => "#{name.to_s.humanize} to be invoked", :banner => "NAME" }
+ { desc: "#{name.to_s.humanize} to be invoked", banner: "NAME" }
end
unless class_options.key?(name)
@@ -343,8 +343,8 @@ module Rails
# Small macro to add ruby as an option to the generator with proper
# default value plus an instance helper method called shebang.
def self.add_shebang_option!
- class_option :ruby, :type => :string, :aliases => "-r", :default => Thor::Util.ruby_command,
- :desc => "Path to the Ruby binary of your choice", :banner => "PATH"
+ class_option :ruby, type: :string, aliases: "-r", default: Thor::Util.ruby_command,
+ desc: "Path to the Ruby binary of your choice", banner: "PATH"
no_tasks {
define_method :shebang do