aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2011-04-12 00:23:07 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-04-12 00:23:07 +0200
commitd1575ae1b9658c91145d6a46ec2a144a5a089207 (patch)
treed630cd4ba2cd512c3be56e33d4e7b45e0cf8fff4 /railties/lib/rails
parent5918b868b24ff384365d436367611aea577f3723 (diff)
downloadrails-d1575ae1b9658c91145d6a46ec2a144a5a089207.tar.gz
rails-d1575ae1b9658c91145d6a46ec2a144a5a089207.tar.bz2
rails-d1575ae1b9658c91145d6a46ec2a144a5a089207.zip
Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion!
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/commands.rb2
-rw-r--r--railties/lib/rails/commands/benchmarker.rb2
-rw-r--r--railties/lib/rails/commands/destroy.rb2
-rw-r--r--railties/lib/rails/commands/generate.rb2
-rw-r--r--railties/lib/rails/commands/profiler.rb2
-rw-r--r--railties/lib/rails/generators/base.rb2
-rw-r--r--railties/lib/rails/generators/generated_attribute.rb2
7 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index 28dff23890..7108d4157e 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -71,7 +71,7 @@ when '--version', '-v'
require 'rails/commands/application'
else
- puts "Error: Command not recognized" unless command.either?('-h', '--help')
+ puts "Error: Command not recognized" unless command.among?('-h', '--help')
puts <<-EOT
Usage: rails COMMAND [ARGS]
diff --git a/railties/lib/rails/commands/benchmarker.rb b/railties/lib/rails/commands/benchmarker.rb
index ecdcccfd8d..e10ec8fd38 100644
--- a/railties/lib/rails/commands/benchmarker.rb
+++ b/railties/lib/rails/commands/benchmarker.rb
@@ -1,6 +1,6 @@
require 'active_support/core_ext/object/inclusion'
-if ARGV.first.either?(nil, "-h", "--help")
+if ARGV.first.among?(nil, "-h", "--help")
puts "Usage: rails benchmarker [times] 'Person.expensive_way' 'Person.another_expensive_way' ..."
exit 1
end
diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb
index 829d29dad7..d082ba592c 100644
--- a/railties/lib/rails/commands/destroy.rb
+++ b/railties/lib/rails/commands/destroy.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/object/inclusion'
Rails::Generators.configure!
-if ARGV.first.either?(nil, "-h", "--help")
+if ARGV.first.among?(nil, "-h", "--help")
Rails::Generators.help 'destroy'
exit
end
diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb
index bef4c6df14..789e5ebedb 100644
--- a/railties/lib/rails/commands/generate.rb
+++ b/railties/lib/rails/commands/generate.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/object/inclusion'
Rails::Generators.configure!
-if ARGV.first.either?(nil, "-h", "--help")
+if ARGV.first.among?(nil, "-h", "--help")
Rails::Generators.help 'generate'
exit
end
diff --git a/railties/lib/rails/commands/profiler.rb b/railties/lib/rails/commands/profiler.rb
index baa3baaec0..d3195a204e 100644
--- a/railties/lib/rails/commands/profiler.rb
+++ b/railties/lib/rails/commands/profiler.rb
@@ -1,6 +1,6 @@
require 'active_support/core_ext/object/inclusion'
-if ARGV.first.either?(nil, "-h", "--help")
+if ARGV.first.among?(nil, "-h", "--help")
$stderr.puts "Usage: rails profiler 'Person.expensive_method(10)' [times] [flat|graph|graph_html]"
exit(1)
end
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index e2c19340f4..2b0eaea3a4 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -165,7 +165,7 @@ module Rails
names.each do |name|
defaults = if options[:type] == :boolean
{ }
- elsif default_value_for_option(name, options).either?(true, false)
+ elsif default_value_for_option(name, options).among?(true, false)
{ :banner => "" }
else
{ :desc => "#{name.to_s.humanize} to be invoked", :banner => "NAME" }
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb
index 8ed3b18872..f85375b2a3 100644
--- a/railties/lib/rails/generators/generated_attribute.rb
+++ b/railties/lib/rails/generators/generated_attribute.rb
@@ -45,7 +45,7 @@ module Rails
end
def reference?
- self.type.either?(:references, :belongs_to)
+ self.type.among?(:references, :belongs_to)
end
end
end