Class: DocToDash::CLI
- Inherits:
-
Object
- Object
- DocToDash::CLI
- Defined in:
- lib/doc_to_dash/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 13 14 15 16 17 |
# File 'lib/doc_to_dash/cli.rb', line 9 def initialize @opts = Trollop:: do DocToDash::CLI. opt :icon, "Docset icon which will display in Dash.", :type => :string opt :name, "Docset name which will display in Dash.", :type => :string opt :output, "Docset Output Path where the docset will be saved.", :type => :string opt :parser, "Docset parser to use.", :type => :string end end |
Class Method Details
.banner_data ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/doc_to_dash/cli.rb', line 35 def self. <<-EOS DocToDash converts RDoc and YARD documentation files to Dash format. Usage: doc_to_dash [options] <docset_path> where [options] are: EOS end |
.run ⇒ Object
5 6 7 |
# File 'lib/doc_to_dash/cli.rb', line 5 def self.run self.new.run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/doc_to_dash/cli.rb', line 19 def run if ARGV.count == 0 puts "Error. Please run doc_to_dash again with the --help switch. Missing <docset_path>." return false end = {} [:doc_input_path] = ARGV.first [:icon_path] = @opts[:icon] unless @opts[:icon].nil? [:docset_name] = @opts[:name] unless @opts[:name].nil? [:docset_output_path] = @opts[:output] unless @opts[:output].nil? [:parser] = DocToDash.const_get(@opts[:parser]) unless @opts[:parser].nil? DocToDash::DocsetGenerator.new().run end |