Module: Albacore::CliDSL::InstanceMethods
- Defined in:
- lib/albacore/cli_dsl.rb
Instance Method Summary collapse
-
#run_command(command) ⇒ Object
Calls an instance method defined via the ::command class method.
Instance Method Details
#run_command(command) ⇒ Object
Calls an instance method defined via the ::command class method. Raises CommandError if the command does not exist.
15 16 17 18 19 20 21 22 |
# File 'lib/albacore/cli_dsl.rb', line 15 def run_command(command) method_name = "#{self.class.command_prefix}#{command}" if self.class.method_defined?(method_name) send method_name else raise CommandError, "invalid command #{command}" end end |