Class: DocumentGenerator::CLI
- Inherits:
-
Object
- Object
- DocumentGenerator::CLI
- Defined in:
- lib/document_generator/cli.rb
Class Method Summary collapse
Class Method Details
.parse(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/document_generator/cli.rb', line 9 def self.parse(args) = OpenStruct.new parser = OptionParser.new do |opts| opts.on('-u', '--url URL', 'URL for the repository') do |url| .url = url end end parser.parse!(args) # TODO: Do something better than this. raise OptionParser::MissingArgument unless .url end |
.start(args) ⇒ Object
3 4 5 6 7 |
# File 'lib/document_generator/cli.rb', line 3 def self.start(args) = parse(args) Repository.new(.url).generate end |