aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-09-18 23:04:12 +0200
committerXavier Noria <fxn@hashref.com>2012-09-18 23:04:12 +0200
commit1e7b8d3a227846d488d16cd3fe9de13aa2f19c7c (patch)
treeef015c271c990887d17df89f576bb1f89a1b8fcc /guides/rails_guides
parentc49d959e9d40101f1712a452004695f4ce27d84c (diff)
downloadrails-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.rb8
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