提交 1e7b8d3a 编写于 作者: X Xavier Noria

let .md be the only supported extension for guides

上级 c49d959e
......@@ -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 @@ def copy_assets
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册