let .md be the only supported extension for guides

This commit is contained in:
Xavier Noria 2012-09-18 23:04:12 +02:00
parent c49d959e9d
commit 1e7b8d3a22
1 changed files with 4 additions and 4 deletions

View File

@ -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