Class: Minitar::CLI::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/minitar/cli/command.rb

Overview

The base for commands in Minitar::CLI. This will be replaced in a future version by one of the better-executed CLI application frameworks like GLI, after Ruby 1.8 and 1.9 support have been dropped.

Direct Known Subclasses

Create, Extract, Help, List

Defined Under Namespace

Modules: CatchMinitarErrors

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commander) ⇒ Command

Returns a new instance of Command.



29
30
31
32
# File 'lib/minitar/cli/command.rb', line 29

def initialize(commander)
  @commander = commander
  @ioe = commander.ioe
end

Class Attribute Details

.childrenObject (readonly)

Returns the value of attribute children.



13
14
15
# File 'lib/minitar/cli/command.rb', line 13

def children
  @children
end

Instance Attribute Details

#commanderObject (readonly)

Returns the value of attribute commander.



9
10
11
# File 'lib/minitar/cli/command.rb', line 9

def commander
  @commander
end

#ioeObject (readonly)

Returns the value of attribute ioe.



10
11
12
# File 'lib/minitar/cli/command.rb', line 10

def ioe
  @ioe
end

Class Method Details

.inherited(subclass) ⇒ Object



15
16
17
# File 'lib/minitar/cli/command.rb', line 15

def inherited(subclass)
  children << subclass
end

Instance Method Details

#call(_args, _opts = {}) ⇒ Object Also known as: []



38
39
40
# File 'lib/minitar/cli/command.rb', line 38

def call(_args, _opts = {})
  raise Minitar::CLI::AbstractCommandError
end

#helpObject



43
44
45
# File 'lib/minitar/cli/command.rb', line 43

def help
  raise Minitar::CLI::AbstractCommandError
end

#nameObject



34
35
36
# File 'lib/minitar/cli/command.rb', line 34

def name
  raise Minitar::CLI::AbstractCommandError
end