Class: Sod::Shell
- Inherits:
-
Object
- Object
- Sod::Shell
- Defined in:
- lib/sod/shell.rb
Overview
The Command Line Interface (CLI).
Instance Attribute Summary collapse
-
#banner ⇒ Object
readonly
Returns the value of attribute banner.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#call(arguments = ARGV, process: Process) ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(name = Cogger::Program.call, banner: nil, node: Graph::Node, runner: Graph::Runner, &block) ⇒ Shell
constructor
rubocop:todo Metrics/ParameterLists.
Constructor Details
#initialize(name = Cogger::Program.call, banner: nil, node: Graph::Node, runner: Graph::Runner, &block) ⇒ Shell
rubocop:todo Metrics/ParameterLists
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sod/shell.rb', line 11 def initialize name = Cogger::Program.call, banner: nil, node: Graph::Node, runner: Graph::Runner, &block @name = name.to_s @banner = graph = node[handle: name, description: ] graph.instance_eval(&block) if block @runner = runner.new graph end |
Instance Attribute Details
#banner ⇒ Object (readonly)
Returns the value of attribute banner.
8 9 10 |
# File 'lib/sod/shell.rb', line 8 def @banner end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/sod/shell.rb', line 8 def name @name end |
Instance Method Details
#call(arguments = ARGV, process: Process) ⇒ Object
rubocop:enable Metrics/ParameterLists
24 25 26 27 |
# File 'lib/sod/shell.rb', line 24 def call arguments = ARGV, process: Process process.setproctitle name runner.call arguments end |