diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-12 00:23:07 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-12 00:23:07 +0200 |
commit | d1575ae1b9658c91145d6a46ec2a144a5a089207 (patch) | |
tree | d630cd4ba2cd512c3be56e33d4e7b45e0cf8fff4 /railties/guides/rails_guides | |
parent | 5918b868b24ff384365d436367611aea577f3723 (diff) | |
download | rails-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/guides/rails_guides')
-rw-r--r-- | railties/guides/rails_guides/textile_extensions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb index f1486a7c10..9beeefb551 100644 --- a/railties/guides/rails_guides/textile_extensions.rb +++ b/railties/guides/rails_guides/textile_extensions.rb @@ -5,7 +5,7 @@ module RailsGuides def notestuff(body) body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)[.:](.*)$/) do |m| css_class = $1.downcase - css_class = 'warning' if css_class.either?('caution', 'important') + css_class = 'warning' if css_class.among?('caution', 'important') result = "<div class='#{css_class}'><p>" result << $2.strip @@ -35,7 +35,7 @@ module RailsGuides def code(body) body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql|plain)>(.*?)</\1>}m) do |m| es = ERB::Util.h($2) - css_class = $1.either?('erb', 'shell') ? 'html' : $1 + css_class = $1.among?('erb', 'shell') ? 'html' : $1 %{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>} end end |