Module: SSC::Handler::Helper::ClassMethods
- Defined in:
- lib/handlers/helper.rb
Instance Method Summary collapse
- #allow_remote_option ⇒ Object
- #get_config ⇒ Object
- #require_appliance_id ⇒ Object
- #require_authorization ⇒ Object
- #require_build_id ⇒ Object
Instance Method Details
#allow_remote_option ⇒ Object
39 40 41 |
# File 'lib/handlers/helper.rb', line 39 def allow_remote_option method_option :remote, :type => :boolean, :default => false end |
#get_config ⇒ Object
43 44 45 46 47 48 49 |
# 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 ⇒ Object
26 27 28 29 30 31 |
# File 'lib/handlers/helper.rb', line 26 def require_appliance_id config= get_config method_option :appliance_id, :type => :numeric, :required => true, :default => config["appliance_id"] end |
#require_authorization ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/handlers/helper.rb', line 16 def 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 ⇒ Object
33 34 35 36 37 |
# 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 |