aboutsummaryrefslogtreecommitdiffstats
path: root/railties/Rakefile
diff options
context:
space:
mode:
authorHongli Lai (Phusion) <hongli@phusion.nl>2008-11-04 15:32:28 +0100
committerHongli Lai (Phusion) <hongli@phusion.nl>2008-11-04 15:32:28 +0100
commitf22458ef85eb2d7bdf25943395baf9335e0805ce (patch)
treedc7e150b049df14cd35ab130a32a16a67be883a1 /railties/Rakefile
parent5b97ca95c56d6720790f11e441bab8e6f4cac2c5 (diff)
downloadrails-f22458ef85eb2d7bdf25943395baf9335e0805ce.tar.gz
rails-f22458ef85eb2d7bdf25943395baf9335e0805ce.tar.bz2
rails-f22458ef85eb2d7bdf25943395baf9335e0805ce.zip
Update guides generation task: make it compatible with the latest changes in Mizuho.
Diffstat (limited to 'railties/Rakefile')
-rw-r--r--railties/Rakefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/railties/Rakefile b/railties/Rakefile
index 872ea83ec2..52357a09c5 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -283,26 +283,35 @@ task :guides do
template = File.expand_path("doc/guides/source/templates/guides.html.erb")
- ignore = ['icons', 'images', 'templates', 'stylesheets']
+ ignore = ['..', 'icons', 'images', 'templates', 'stylesheets']
ignore << 'active_record_basics.txt'
indexless = ['index.txt', 'authors.txt']
- Dir.entries(source)[2..-1].each do |entry|
+ # Traverse all entries in doc/guides/source/
+ Dir.entries(source).each do |entry|
next if ignore.include?(entry)
if File.directory?(File.join(source, entry))
- input = File.join(source, entry, 'index.txt')
- output = File.join(html, entry)
+ # If the current entry is a directory, then we will want to compile
+ # the 'index.txt' file inside this directory.
+ if entry == '.'
+ input = File.join(source, 'index.txt')
+ output = File.join(html, "index.html")
+ else
+ input = File.join(source, entry, 'index.txt')
+ output = File.join(html, "#{entry}.html")
+ end
else
+ # If the current entry is a file, then we will want to compile this file.
input = File.join(source, entry)
- output = File.join(html, entry).sub(/\.txt$/, '')
+ output = File.join(html, entry).sub(/\.txt$/, '.html')
end
begin
puts "GENERATING => #{output}"
ENV['MANUALSONRAILS_TOC'] = 'no' if indexless.include?(entry)
- Mizuho::Generator.new(input, output, template).start
+ Mizuho::Generator.new(input, :output => output, :template => template).start
rescue Mizuho::GenerationError
STDERR.puts "*** ERROR"
exit 2