diff options
Diffstat (limited to 'railties/Rakefile')
-rw-r--r-- | railties/Rakefile | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/railties/Rakefile b/railties/Rakefile index 692c96ddbb..30d3748441 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' @@ -285,13 +285,23 @@ task :guides do asciidoc_conf = 'doc/guides/asciidoc.conf' ignore = ['..', 'icons', 'images', 'templates', 'stylesheets'] - ignore << 'active_record_basics.txt' + #ignore << 'active_record_basics.txt' indexless = ['index.txt', 'authors.txt'] - # Traverse all entries in doc/guides/source/ - Dir.entries(source).each do |entry| - next if ignore.include?(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) or entry =~ /^\./ # because Vim is always saving hidden swap files if File.directory?(File.join(source, entry)) # If the current entry is a directory, then we will want to compile |