Skip to content

Commit f2aa34c

Browse files
tiennoucarlosmn
authored andcommitted
Allow restricting the version to build
1 parent 1bfe43b commit f2aa34c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

bin/cm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ version Docurium::Version
1313
desc 'Generate HTML documentation'
1414
long_desc 'Generate HTML docs from a Docurium config file'
1515
command :doc do |c|
16+
c.flag :for, :desc => "The version to generate", :multiple => true
1617
c.action do |global_options,options,args|
1718
file = args.first
1819
Docurium::CLI.doc(file, options)

lib/docurium.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@ def generate_doc_for(version)
119119
data
120120
end
121121

122-
def generate_docs
122+
def generate_docs(options)
123123
output_index = Rugged::Index.new
124124
write_site(output_index)
125125
@tf = File.expand_path(File.join(File.dirname(__FILE__), 'docurium', 'layout.mustache'))
126126
versions = get_versions
127127
versions << 'HEAD'
128+
versions = versions & options[:for] unless options[:for].empty?
128129
nversions = versions.size
129130
output = Queue.new
130131
pipes = {}

lib/docurium/cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class CLI
33

44
def self.doc(idir, options)
55
doc = Docurium.new(idir)
6-
doc.generate_docs
6+
doc.generate_docs(options)
77
end
88

99
def self.gen(file)

0 commit comments

Comments
 (0)