Class: Pione::Command::BasicCommand

Inherits:
PioneObject
  • Object
show all
Extended by:
ClassInterface, Pione::CommandOption::OptionInterface
Includes:
InstanceInterface
Defined in:
lib/pione/command/basic-command.rb

Overview

BasicCommand is a base class for PIONE commands.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassInterface

program_message, program_name, set_program_message, set_program_name

Methods included from Pione::CommandOption::OptionInterface

command_options, define_option, extended, remove_option, use_option_module

Methods included from InstanceInterface

#program_message, #program_name

Class Method Details

.inherited(subclass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



53
54
55
56
# File 'lib/pione/command/basic-command.rb', line 53

def self.inherited(subclass)
  opts = command_options.clone
  subclass.instance_eval { @command_options = opts }
end

.run(*args) ⇒ Object

Runs the command.



59
60
61
# File 'lib/pione/command/basic-command.rb', line 59

def self.run(*args)
  self.new(*args).run
end

Instance Method Details

#runObject

Runs the command.



64
65
66
67
68
69
70
# File 'lib/pione/command/basic-command.rb', line 64

def run
  parse_options
  validate_options
  prepare
  $PROGRAM_NAME = program_name
  start
end