diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/commands/destroy.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/commands/generate.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/engine/commands.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/base.rb | 3 |
6 files changed, 7 insertions, 14 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 9521805778..2b36cc9d0d 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -49,7 +49,7 @@ module Rails @assets = ActiveSupport::OrderedOptions.new @assets.enabled = false @assets.paths = [] - @assets.precompile = [ Proc.new{ |path| !File.extname(path).in?(['.js', '.css']) }, + @assets.precompile = [ Proc.new { |path| !%w(.js .css).include?(File.extname(path)) }, /(?:\/|\\|\A)application\.(css|js)$/ ] @assets.prefix = "/assets" @assets.version = '' diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index 8816387d34..9c5dc8f188 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/object/inclusion' - ARGV << '--help' if ARGV.empty? aliases = { @@ -71,7 +69,7 @@ when 'application', 'runner' require "rails/commands/#{command}" when 'new' - if ARGV.first.in?(['-h', '--help']) + if %w(-h --help).include?(ARGV.first) require 'rails/commands/application' else puts "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n" @@ -84,7 +82,7 @@ when '--version', '-v' require 'rails/commands/application' else - puts "Error: Command not recognized" unless command.in?(['-h', '--help']) + puts "Error: Command not recognized" unless %w(-h --help).include?(command) puts <<-EOT Usage: rails COMMAND [ARGS] diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb index ae354eca97..9023c61bf2 100644 --- a/railties/lib/rails/commands/destroy.rb +++ b/railties/lib/rails/commands/destroy.rb @@ -1,7 +1,6 @@ require 'rails/generators' -require 'active_support/core_ext/object/inclusion' -if ARGV.first.in?([nil, "-h", "--help"]) +if [nil, "-h", "--help"].include?(ARGV.first) Rails::Generators.help 'destroy' exit end diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index 1fb2d98834..9f13cb0513 100644 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -1,7 +1,6 @@ require 'rails/generators' -require 'active_support/core_ext/object/inclusion' -if ARGV.first.in?([nil, "-h", "--help"]) +if [nil, "-h", "--help"].include?(ARGV.first) Rails::Generators.help 'generate' exit end diff --git a/railties/lib/rails/engine/commands.rb b/railties/lib/rails/engine/commands.rb index ffbc0b4bd6..072d16291b 100644 --- a/railties/lib/rails/engine/commands.rb +++ b/railties/lib/rails/engine/commands.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/object/inclusion' - ARGV << '--help' if ARGV.empty? aliases = { @@ -25,7 +23,7 @@ when '--version', '-v' require 'rails/commands/application' else - puts "Error: Command not recognized" unless command.in?(['-h', '--help']) + puts "Error: Command not recognized" unless %w(-h --help).include?(command) puts <<-EOT Usage: rails COMMAND [ARGS] diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index a49a1724c5..a3f8ebf476 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -8,7 +8,6 @@ rescue LoadError end require 'rails/generators/actions' -require 'active_support/core_ext/object/inclusion' module Rails module Generators @@ -171,7 +170,7 @@ module Rails names.each do |name| defaults = if options[:type] == :boolean { } - elsif default_value_for_option(name, options).in?([true, false]) + elsif [true, false].include?(default_value_for_option(name, options)) { :banner => "" } else { :desc => "#{name.to_s.humanize} to be invoked", :banner => "NAME" } |