aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/rails_guides
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-08 09:42:50 +0100
committerXavier Noria <fxn@hashref.com>2010-02-08 09:42:50 +0100
commit2928040e236cebc0c845211d074eadfbf019258c (patch)
tree9c9d1ff02ef7ad15c97a547299dca7e8ebcc68cd /railties/guides/rails_guides
parent6a6644742f81b1f7a8b8f35f43873bbf8827f1f1 (diff)
downloadrails-2928040e236cebc0c845211d074eadfbf019258c.tar.gz
rails-2928040e236cebc0c845211d074eadfbf019258c.tar.bz2
rails-2928040e236cebc0c845211d074eadfbf019258c.zip
simplify a couple of regexps
Diffstat (limited to 'railties/guides/rails_guides')
-rw-r--r--railties/guides/rails_guides/textile_extensions.rb4
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 082c2efddd..affef1ccb0 100644
--- a/railties/guides/rails_guides/textile_extensions.rb
+++ b/railties/guides/rails_guides/textile_extensions.rb
@@ -1,7 +1,7 @@
module RailsGuides
module TextileExtensions
def notestuff(body)
- body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)(?:\.|\:)(.*)$/) do |m|
+ body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)[.:](.*)$/) do |m|
css_class = $1.downcase
css_class = 'warning' if ['caution', 'important'].include?(css_class)
@@ -13,7 +13,7 @@ module RailsGuides
end
def tip(body)
- body.gsub!(/^TIP(?:\.|\:)(.*)$/) do |m|
+ body.gsub!(/^TIP[.:](.*)$/) do |m|
result = "<div class='info'><p>"
result << $1.strip
result << '</p></div>'