Class: Gistory::Cli::ArgParser
- Inherits:
-
Object
- Object
- Gistory::Cli::ArgParser
- Defined in:
- lib/gistory/cli/arg_parser.rb
Instance Method Summary collapse
-
#initialize(args:, io: Gistory::Cli::Io.new) ⇒ ArgParser
constructor
A new instance of ArgParser.
- #parse ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#parse ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/gistory/cli/arg_parser.rb', line 15 def parse @parser.parse!(@args) parse_gem_name @io.error("extra parameters ignored: #{@args}") unless @args.count.zero? @config rescue OptionParser::InvalidOption => e raise(Gistory::ParserError, e.) end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/gistory/cli/arg_parser.rb', line 25 def to_s @parser.to_s end |