From fe1bf7d34dc5ddd1999b90fc7d571c9516e21e66 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 16 Jan 2010 10:42:04 +1000 Subject: [PATCH] The behaviour has changed between 1.8 and 1.9, Array#to_s now prints out an inspect-like version of the array. To duplicate this previous behaviour, we use .join(" "). Secondly, we do not need to escape the h character in the regex as it is simply a character. --- railties/guides/rails_guides/generator.rb | 2 +- railties/guides/rails_guides/indexer.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index cebf6ae..e3df3be 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -95,7 +95,7 @@ module RailsGuides view.content_tag(:li, l) end - children_ul = view.content_tag(:ul, children) + children_ul = view.content_tag(:ul, children.join(" ")) index << view.content_tag(:li, link + children_ul) end diff --git a/railties/guides/rails_guides/indexer.rb b/railties/guides/rails_guides/indexer.rb index 5b5ad3f..939404c 100644 --- a/railties/guides/rails_guides/indexer.rb +++ b/railties/guides/rails_guides/indexer.rb @@ -19,9 +19,9 @@ module RailsGuides level_hash = ActiveSupport::OrderedHash.new while !s.eos? - s.match?(/\h[0-9]\..*$/) + s.match?(/h[0-9]\..*$/) if matched = s.matched - matched =~ /\h([0-9])\.(.*)$/ + matched =~ /h([0-9])\.(.*)$/ level, title = $1.to_i, $2 if level < current_level -- 1.6.4.1