module SSC::Handler::Helper::ClassMethods

Public Instance Methods

allow_remote_option() click to toggle source
# File lib/handlers/helper.rb, line 39
def allow_remote_option
  method_option :remote, :type => :boolean, :default => false
end
get_config() click to toggle source
# File lib/handlers/helper.rb, line 43
def get_config
  begin
    YAML::load File.read(File.join('.', '.sscrc'))
  rescue Errno::ENOENT
    return {'username' => nil, 'password' => nil, 'appliance_id' => nil}
  end
end
require_appliance_id() click to toggle source
# File lib/handlers/helper.rb, line 26
def require_appliance_id
  require_authorization
  config= get_config
  method_option :appliance_id, :type => :numeric, :required => true,
    :default => config["appliance_id"]
end
require_authorization() click to toggle source
# File lib/handlers/helper.rb, line 16
def require_authorization
  config= get_config
  method_option :username, :type => :string, :required => true, 
    :default => config["username"], :aliases => "-u"
  method_option :password, :type => :string, :required => true, 
    :default => config["password"], :aliases => "-p"
  method_option :proxy, :type => :string
  method_option :timeout, :type => :string
end
require_build_id() click to toggle source
# File lib/handlers/helper.rb, line 33
def require_build_id
  config= get_config
  method_option :build_id, :type => :numeric, :required => true,
    :default => config["latest_build_id"]
end