diff options
author | Xavier Noria <fxn@hashref.com> | 2012-09-18 23:04:12 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-09-18 23:04:12 +0200 |
commit | 1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c (patch) | |
tree | ef015c271c990887d17df89f576bb1f89a1b8fcc /guides/rails_guides | |
parent | c49d959e9d40101f1712a452004695f4ce27d84c (diff) | |
download | rails-1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c.tar.gz rails-1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c.tar.bz2 rails-1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c.zip |
let .md be the only supported extension for guides
Diffstat (limited to 'guides/rails_guides')
-rw-r--r-- | guides/rails_guides/generator.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index eda9fd03a6..3b124ef236 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -65,7 +65,7 @@ module RailsGuides class Generator attr_reader :guides_dir, :source_dir, :output_dir, :edge, :warnings, :all - GUIDES_RE = /\.(?:erb|md|markdown)$/ + GUIDES_RE = /\.(?:erb|md)\z/ def initialize(output=nil) set_flags_from_environment @@ -172,10 +172,10 @@ module RailsGuides end def output_file_for(guide) - if guide =~ /\.(markdown|md)$/ - guide.sub(/\.(markdown|md)$/, '.html') + if guide.end_with?('.md') + guide.sub(/md\z/, 'html') else - guide.sub(/\.erb$/, '') + guide.sub(/\.erb\z/, '') end end |