From 50be5f039b310b61991c5e1de2b52c32564227b3 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 2 Sep 2009 20:47:15 +0200 Subject: [PATCH] fixes generation of index and credits page --- railties/guides/rails_guides/generator.rb | 6 +++--- .../source/{credits.erb.textile => credits.textile.erb} | 0 .../guides/source/{index.erb.textile => index.textile.erb} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename railties/guides/source/{credits.erb.textile => credits.textile.erb} (100%) rename railties/guides/source/{index.erb.textile => index.textile.erb} (100%) diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index a9467cdf80..341f570251 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -18,7 +18,7 @@ module RailsGuides end def generate - guides = Dir.entries(view_path).find_all {|g| g =~ /textile$/ } + guides = Dir.entries(view_path).find_all {|g| g =~ /\.textile(?:\.erb)?$/ } if ENV["ONLY"] only = ENV["ONLY"].split(",").map{|x| x.strip }.map {|o| "#{o}.textile" } @@ -36,7 +36,7 @@ module RailsGuides end def generate_guide(guide) - guide =~ /(.*?)(\.erb)?\.textile/ + guide =~ /(.*?)\.textile(?:\.erb)?$/ name = $1 puts "Generating #{name}" @@ -46,7 +46,7 @@ module RailsGuides @view = ActionView::Base.new(view_path) @view.extend(Helpers) - if guide =~ /\.erb\.textile/ + if guide =~ /\.textile\.erb$/ # Generate the erb pages with textile formatting - e.g. index/authors result = view.render(:layout => 'layout', :file => guide) f.write textile(result) diff --git a/railties/guides/source/credits.erb.textile b/railties/guides/source/credits.textile.erb similarity index 100% rename from railties/guides/source/credits.erb.textile rename to railties/guides/source/credits.textile.erb diff --git a/railties/guides/source/index.erb.textile b/railties/guides/source/index.textile.erb similarity index 100% rename from railties/guides/source/index.erb.textile rename to railties/guides/source/index.textile.erb