Class: AIHype::CLI
- Inherits:
-
Object
- Object
- AIHype::CLI
- Defined in:
- lib/aihype/cli.rb
Constant Summary collapse
- DEFAULT_CONFIG_PATH =
'memory/aihype.md'- DEFAULT_LOG_PATH =
'memory/aihype.log'
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#command_args ⇒ Object
readonly
Returns the value of attribute command_args.
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#log_path ⇒ Object
readonly
Returns the value of attribute log_path.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(argv = ARGV) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ CLI
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/aihype/cli.rb', line 20 def initialize(argv = ARGV) @config_path = DEFAULT_CONFIG_PATH @log_path = DEFAULT_LOG_PATH @verbose = false @mode = :pty @config_path_specified = false @command = nil @command_args = [] (argv) end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def command @command end |
#command_args ⇒ Object (readonly)
Returns the value of attribute command_args.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def command_args @command_args end |
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def config_path @config_path end |
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def log_path @log_path end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def mode @mode end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
18 19 20 |
# File 'lib/aihype/cli.rb', line 18 def verbose @verbose end |
Instance Method Details
#run ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/aihype/cli.rb', line 31 def run case @mode when :init run_init when :validate run_validate when :pty run_pty else raise "Unknown mode: #{@mode}" end end |