aboutsummaryrefslogtreecommitdiffstats
path: root/railties/Rakefile
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-11-06 01:10:30 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-11-06 01:10:30 +0530
commit396d599e24cbfa15c62b20fab8cc02cdba046ce3 (patch)
tree11dd8368e2674342098af21136893bee491c44ff /railties/Rakefile
parent32089cbcc9ca3fb935f783e7a7ef2b60b7d43006 (diff)
downloadrails-396d599e24cbfa15c62b20fab8cc02cdba046ce3.tar.gz
rails-396d599e24cbfa15c62b20fab8cc02cdba046ce3.tar.bz2
rails-396d599e24cbfa15c62b20fab8cc02cdba046ce3.zip
Update guides from docrails
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