Class: RubyEdit::CLI
- Inherits:
-
Thor
- Object
- Thor
- RubyEdit::CLI
- Defined in:
- lib/ruby_edit/cli.rb
Overview
Handle the application command line parsing and the dispatch to various command objects
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Instance Method Summary collapse
Instance Method Details
#configure ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/ruby_edit/cli.rb', line 27 def configure(*) if [:help] invoke :help, ['configure'] else require_relative 'commands/configure' RubyEdit::Commands::Configure.new().execute end end |
#edit ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ruby_edit/cli.rb', line 42 def edit(*) if [:help] invoke :help, ['edit'] elsif .empty? invoke :help else require_relative 'commands/edit' RubyEdit::Commands::Edit.new().execute end end |
#version ⇒ Object
15 16 17 18 |
# File 'lib/ruby_edit/cli.rb', line 15 def version require_relative 'version' puts "v#{RubyEdit::VERSION}" end |