Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added command-line arguments to the bin/generate script to allow for

generating just en/edge (--edge) or a single specific lang/ver (en
1.6.0), while leaving the default to generate all languages and all
versions. This makes it much quicker to generate just the edge docs
when that is the only one being worked on.
  • Loading branch information...
commit 27f5921cac9b446b758e9efed6e07e853ccf9a17 1 parent f8894a3
Marcel Kinard cmarcelk authored
Showing with 15 additions and 2 deletions.
  1. +12 −1 bin/generate
  2. +3 −1 lib/docs_generator.rb
13 bin/generate
View
@@ -22,6 +22,17 @@ $: << File.join(File.dirname(__FILE__), '..', 'lib')
require 'docs_generator'
generator = DocsGenerator.new
-generator.run
+
+# Can be invoked without any args, or with a specific language/version
+# such as "bin/generate en edge" which will build just that one, or
+# with the --edge flag to build just en/edge.
+if (ARGV[0] && (ARGV[0] == "--edge"))
+ generator.run("en", "edge")
+elsif (ARGV[0] && ARGV[1])
+ generator.run(ARGV[0], ARGV[1])
+else
+ # build all languages and versions
+ generator.run
+end
puts " => #{generator.output_directory}"
4 lib/docs_generator.rb
View
@@ -50,17 +50,19 @@ def initialize(input_directory = nil, output_directory = nil)
# - Pre-file processing
# - Release and cleanup
#
- def run
+ def run(one_lang = nil, one_version = nil)
empty_output_directory
ignore_list = ['.', '..', '.DS_Store']
Dir.foreach @input_directory do |language_dir|
next if ignore_list.include? language_dir
+ next if one_lang and language_dir != one_lang
language_path = File.join @input_directory, language_dir
Dir.foreach language_path do |version_dir|
next if ignore_list.include? version_dir
+ next if one_version and version_dir != one_version
output_path = File.join @output_directory, language_dir, version_dir
input_path = File.join @input_directory, language_dir, version_dir
options = { :lang => language_dir, :version => version_dir }
Please sign in to comment.
Something went wrong with that request. Please try again.