Class: ScDocs::Generator
- Inherits:
-
Object
- Object
- ScDocs::Generator
- Defined in:
- lib/sc_docs/generator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#input_dirs ⇒ Object
readonly
Returns the value of attribute input_dirs.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#smartdown ⇒ Object
readonly
Returns the value of attribute smartdown.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #command ⇒ Object
- #generate ⇒ Object
-
#initialize(directories, options = {}) ⇒ Generator
constructor
A new instance of Generator.
- #preview ⇒ Object
Constructor Details
#initialize(directories, options = {}) ⇒ Generator
Returns a new instance of Generator.
18 19 20 21 22 23 |
# File 'lib/sc_docs/generator.rb', line 18 def initialize(directories, ={}) @input_dirs = directories.map{|d| File.(d) } @output_dir = File.([:output_dir]) @smartdown = false @verbose = [:verbose] end |
Instance Attribute Details
#input_dirs ⇒ Object (readonly)
Returns the value of attribute input_dirs.
8 9 10 |
# File 'lib/sc_docs/generator.rb', line 8 def input_dirs @input_dirs end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
10 11 12 |
# File 'lib/sc_docs/generator.rb', line 10 def output_dir @output_dir end |
#smartdown ⇒ Object (readonly)
Returns the value of attribute smartdown.
14 15 16 |
# File 'lib/sc_docs/generator.rb', line 14 def smartdown @smartdown end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
12 13 14 |
# File 'lib/sc_docs/generator.rb', line 12 def template @template end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
16 17 18 |
# File 'lib/sc_docs/generator.rb', line 16 def verbose @verbose end |
Instance Method Details
#command ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/sc_docs/generator.rb', line 25 def command @command ||= begin run_js_path = File.("../../../vendor/jsdoc/app/run.js", __FILE__) command = "#{run_js_path} -a -v -r=20 -t=\"#{template}\" #{input_dirs.map{|d| %{"#{d}"} }.join(' ')} " << "-d=\"#{output_dir}\" -f=class.js -l=Docs.Class" command << " --smartdown" if smartdown command end end |
#generate ⇒ Object
35 36 37 38 |
# File 'lib/sc_docs/generator.rb', line 35 def generate prep run_command end |
#preview ⇒ Object
40 41 42 43 44 |
# File 'lib/sc_docs/generator.rb', line 40 def preview prep run_command run_server end |