class Nucleon::Plugin::Command

Public Instance Methods

args(default = []) click to toggle source
# File lib/core/plugin/command.rb, line 34
def args(default = [])
  return array(get(:args, default)) 
end
args=(args) click to toggle source
# File lib/core/plugin/command.rb, line 40
def args=args
  set(:args, array(args))
end
build(components = {}, overrides = nil, override_key = false) click to toggle source
# File lib/core/plugin/command.rb, line 79
def build(components = {}, overrides = nil, override_key = false)
  logger.debug("Building command with #{components.inspect}")
  logger.debug("Overrides: #{overrides.inspect}")
  logger.debug("Override key: #{override_key}")
  
  return '' # Implement in sub classes
end
command(default = '') click to toggle source
# File lib/core/plugin/command.rb, line 22
def command(default = '')
  return string(get(:command, default))
end
command=(command) click to toggle source
# File lib/core/plugin/command.rb, line 28
def command=command
  set(:command, string(command))
end
data(default = {}) click to toggle source
# File lib/core/plugin/command.rb, line 58
def data(default = {})
  return hash(get(:data, default)) 
end
data=(data) click to toggle source
# File lib/core/plugin/command.rb, line 64
def data=data
  set(:data, hash(data))
end
exec(options = {}, overrides = nil) click to toggle source
# File lib/core/plugin/command.rb, line 89
def exec(options = {}, overrides = nil)
  logger.debug("Executing command with #{options.inspect}")
  logger.debug("Overrides: #{overrides.inspect}")
  
  # Implement in sub classes (don't forget the yield!)
  return true
end
flags(default = []) click to toggle source
# File lib/core/plugin/command.rb, line 46
def flags(default = [])
  return array(get(:flags, default)) 
end
flags=(flags) click to toggle source
# File lib/core/plugin/command.rb, line 52
def flags=flags
  set(:flags, array(flags))
end
normalize(reload) click to toggle source
# File lib/core/plugin/command.rb, line 9
def normalize(reload)
  super
end
subcommand=(subcommand) click to toggle source
# File lib/core/plugin/command.rb, line 70
def subcommand=subcommand
  unless Util::Data.empty?(subcommand)
    set(:subcommand, new(hash(subcommand)))
  end
end
to_s() click to toggle source
# File lib/core/plugin/command.rb, line 15
def to_s
  return build(export)
end