Permalink
Browse files

let .md be the only supported extension for guides

  • Loading branch information...
1 parent c49d959 commit 1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c @fxn fxn committed Sep 18, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 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 @@ 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

3 comments on commit 1e7b8d3

Member

sikachu replied Sep 18, 2012

❤️

Totally agreed.

Member

schneems replied Sep 18, 2012

❤️

Please sign in to comment.