Class: Sekrit::Config
Instance Attribute Summary collapse
-
#bundled_files ⇒ Object
readonly
Returns the value of attribute bundled_files.
-
#bundles ⇒ Object
readonly
Returns the value of attribute bundles.
-
#passphrase ⇒ Object
readonly
Returns the value of attribute passphrase.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#shared_files ⇒ Object
readonly
Returns the value of attribute shared_files.
Instance Method Summary collapse
-
#initialize(path: 'Sekritfile') ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(path: 'Sekritfile') ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 20 21 |
# File 'lib/sekrit/config.rb', line 13 def initialize(path: 'Sekritfile') @raw = File.read(path) config = YAML::load_file(path) @bundled_files = Bundle.new(hash: config['bundled_files']) unless config['bundled_files'].nil? @bundles = (config['bundles'] || []).map { |b| Bundle.new(hash: b) } @passphrase = config['passphrase'] @repo = config['repo'] @shared_files = Bundle.new(hash: config['shared_files']) unless config['shared_files'].nil? end |
Instance Attribute Details
#bundled_files ⇒ Object (readonly)
Returns the value of attribute bundled_files.
8 9 10 |
# File 'lib/sekrit/config.rb', line 8 def bundled_files @bundled_files end |
#bundles ⇒ Object (readonly)
Returns the value of attribute bundles.
6 7 8 |
# File 'lib/sekrit/config.rb', line 6 def bundles @bundles end |
#passphrase ⇒ Object (readonly)
Returns the value of attribute passphrase.
9 10 11 |
# File 'lib/sekrit/config.rb', line 9 def passphrase @passphrase end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
11 12 13 |
# File 'lib/sekrit/config.rb', line 11 def raw @raw end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
10 11 12 |
# File 'lib/sekrit/config.rb', line 10 def repo @repo end |
#shared_files ⇒ Object (readonly)
Returns the value of attribute shared_files.
7 8 9 |
# File 'lib/sekrit/config.rb', line 7 def shared_files @shared_files end |