class Archive::Tar::Minitar::Command::CommandPattern
Attributes
default[RW]
Public Instance Methods
<<(command)
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 249 def <<(command) add(command) end
[](cmd)
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 278 def [](cmd) self.command(cmd) end
add(command)
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 232 def add(command) command = command.new if command.kind_of?(Class) @commands ||= {} if @commands.has_key?(command.name) raise CommandAlreadyExists else @commands[command.name] = command end if command.respond_to?(:altname) unless @commands.has_key?(command.altname) @commands[command.altname] = command end end end
call(args, opts = {}, ioe = {})
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 298 def call(args, opts = {}, ioe = {}) raise AbstractCommandError end
command(command)
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 270 def command(command) if command?(command) @commands[command] else @default end end
command?(command)
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 266 def command?(command) @commands.has_key?(command) end
default_ioe(ioe = {})
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 282 def default_ioe(ioe = {}) ioe[:input] ||= $stdin ioe[:output] ||= $stdout ioe[:error] ||= $stderr ioe end
help()
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 302 def help raise AbstractCommandError end
name()
click to toggle source
# File lib/archive/tar/minitar/command.rb, line 294 def name raise AbstractCommandError end