mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
let .md be the only supported extension for guides
This commit is contained in:
parent
c49d959e9d
commit
1e7b8d3a22
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue