Class: QB::Ansible::ConfigFile::Defaults
- Inherits:
-
Hash
- Object
- Hash
- QB::Ansible::ConfigFile::Defaults
- Defined in:
- lib/qb/ansible/config_file.rb
Overview
Wrapper around the Hash from the [defaults]
group in an Asnible
config file.
Instances are returned from #defaults.
Instance Attribute Summary collapse
-
#rel_root ⇒ Object
readonly
Returns the value of attribute rel_root.
Instance Method Summary collapse
-
#initialize(source, rel_root:) ⇒ Defaults
constructor
Instantiate a new
QB::Ansible::ConfigFile
. -
#roles_path ⇒ Array<Pathname>
Array of resolved (absolute) Pathname instances parsed from the
roles_path
value.
Constructor Details
#initialize(source, rel_root:) ⇒ Defaults
Instantiate a new QB::Ansible::ConfigFile
.
60 61 62 63 64 |
# File 'lib/qb/ansible/config_file.rb', line 60 def initialize source, rel_root: super() source.each_pair { |k, v| self[k] = v } @rel_root = rel_root end |
Instance Attribute Details
#rel_root ⇒ Object (readonly)
Returns the value of attribute rel_root.
49 50 51 |
# File 'lib/qb/ansible/config_file.rb', line 49 def rel_root @rel_root end |
Instance Method Details
#roles_path ⇒ Array<Pathname>
Returns Array of resolved (absolute) Pathname instances parsed from the
roles_path
value. Empty array roles_path
key is missing.
74 75 76 77 78 79 80 81 82 |
# File 'lib/qb/ansible/config_file.rb', line 74 def roles_path if key? 'roles_path' self['roles_path']. split(':'). map { |path| QB::Util.resolve @rel_root, path } else [] end end |