Class: Status::Config
- Inherits:
-
Object
- Object
- Status::Config
- Defined in:
- lib/status/config.rb
Constant Summary collapse
- FILE =
".status.yml"
Instance Attribute Summary collapse
-
#parsed ⇒ Object
readonly
Returns the value of attribute parsed.
Instance Method Summary collapse
- #bootstrap ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
9 10 11 12 |
# File 'lib/status/config.rb', line 9 def initialize bootstrap validate end |
Instance Attribute Details
#parsed ⇒ Object (readonly)
Returns the value of attribute parsed.
8 9 10 |
# File 'lib/status/config.rb', line 8 def parsed @parsed end |
Instance Method Details
#bootstrap ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/status/config.rb', line 23 def bootstrap @parsed = begin YAML.load(File.open(FILE)) rescue Exception => e create_file puts "Could not parse YAML file #{FILE}: #{e.}" abort("exit") end end |
#validate ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/status/config.rb', line 14 def validate validate_presence_of :owner validate_presence_of :repo validate_presence_of :token validate_presence_of :ci_url, "ci" validate_presence_of :username, "ci" validate_presence_of :password, "ci" end |