diff options
author | Karel Minarik <karmi@karmi.cz> | 2009-01-18 00:05:18 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-01-18 00:07:07 +0000 |
commit | 4059f0477dc0504eed4c989560e92f60e9e7d764 (patch) | |
tree | 5e8cb17cbfde193da2276b97bbf241e9f4aa484b /railties | |
parent | fe01a13ac5af7d3fb6a37035870e99bc8096f87a (diff) | |
download | rails-4059f0477dc0504eed4c989560e92f60e9e7d764.tar.gz rails-4059f0477dc0504eed4c989560e92f60e9e7d764.tar.bz2 rails-4059f0477dc0504eed4c989560e92f60e9e7d764.zip |
Add rake task for generating a subset of guides
rake guides ONLY='migrations i18n'
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/Rakefile | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/railties/Rakefile b/railties/Rakefile index 692c96ddbb..be0f449efc 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -272,7 +272,7 @@ Rake::RDocTask.new { |rdoc| rdoc.rdoc_files.include('lib/commands/**/*.rb') } -desc "Generate guides for the framework" +desc "Generate guides for the framework. Use ONLY='migrations i18n.txt' option to build just specific ones." task :guides do require 'mizuho/generator' @@ -289,8 +289,18 @@ task :guides do indexless = ['index.txt', 'authors.txt'] - # Traverse all entries in doc/guides/source/ - Dir.entries(source).each do |entry| + # Traverse all entries in doc/guides/source/ or only those specified in ONLY env variable + entries = Dir.entries(source) + if ENV['ONLY'] + only = ENV['ONLY'].split(' ') + unless only.empty? + entries = entries.select do |e| + only.include?(e) || only.include?(e.sub(/\.txt$/, '')) + end + end + end + + entries.each do |entry| next if ignore.include?(entry) if File.directory?(File.join(source, entry)) |