Class: JsDocToolkit::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/jsdoc-toolkit/generator.rb

Constant Summary collapse

DefaultOptions =
{:recurse => "-r", :all => "-a", :template => %Q[-t=#{JsDocTemplatePath + "jsdoc"}],
:verbose => "-v", :unique => "-u"}

Instance Method Summary collapse

Instance Method Details

#build(options) ⇒ Object

Raises:

  • (RuntimeError)


9
10
11
12
13
14
15
16
# File 'lib/jsdoc-toolkit/generator.rb', line 9

def build(options)
  src_files, doc_dir = Array(options[:src_files]), Pathname(options[:doc_dir].to_s)
  raise RuntimeError, "java was not found in your PATH." if `which java 2>/dev/null`.strip.empty?
  raise ArgumentError, ":src_files was not specified or was empty" if src_files.empty?
  raise ArgumentError, ":doc_dir was not specified or does not exist" unless options[:doc_dir] && doc_dir.exist?

  run_jsdoc(src_files, doc_dir)
end