Class: CLIForge::CommandSet
- Inherits:
-
Object
- Object
- CLIForge::CommandSet
- Defined in:
- lib/cli_forge/command_set.rb
Instance Method Summary collapse
- #[](command_name) ⇒ Object
-
#initialize(config) ⇒ CommandSet
constructor
A new instance of CommandSet.
Constructor Details
#initialize(config) ⇒ CommandSet
Returns a new instance of CommandSet.
3 4 5 |
# File 'lib/cli_forge/command_set.rb', line 3 def initialize(config) @config = config end |
Instance Method Details
#[](command_name) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cli_forge/command_set.rb', line 7 def [](command_name) if = @config.[command_name.to_sym] return end target_bin = @config.bin_name + @config.bin_separator + command_name.to_s commands = find_bin_commands(target_bin) # if commands.size > 1 # TODO: Warn # end commands.first end |