Class: TinyCI::Config
- Inherits:
-
Object
- Object
- TinyCI::Config
- Includes:
- Symbolize
- Defined in:
- lib/tinyci/config.rb
Overview
Represents the Configuration for a repo, parsed from the .tinyci.yml file in the repo root.
Mainly a wrapper around a the hash object parsed from the yaml in the config file.
The keys of the hash are recursively symbolized.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Address into the config object.
-
#initialize(working_dir: '.', config_path: nil, config: nil) ⇒ Config
constructor
Constructor.
-
#to_hash ⇒ Object
Return the raw hash representation.
Methods included from Symbolize
Constructor Details
#initialize(working_dir: '.', config_path: nil, config: nil) ⇒ Config
Constructor
18 19 20 21 22 23 24 |
# File 'lib/tinyci/config.rb', line 18 def initialize(working_dir: '.', config_path: nil, config: nil) @working_dir = working_dir @config_pathname = config_path @config_content = config raise ConfigMissingError, "config file #{config_pathname} not found" unless config_file_exists? end |
Instance Method Details
#[](key) ⇒ Object
Address into the config object
29 30 31 |
# File 'lib/tinyci/config.rb', line 29 def [](key) config_content[key] end |
#to_hash ⇒ Object
Return the raw hash representation
34 35 36 |
# File 'lib/tinyci/config.rb', line 34 def to_hash config_content end |