Class: Sekrit::Config

Inherits:
Object show all
Defined in:
lib/sekrit/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_filesObject (readonly)

Returns the value of attribute bundled_files.



8
9
10
# File 'lib/sekrit/config.rb', line 8

def bundled_files
  @bundled_files
end

#bundlesObject (readonly)

Returns the value of attribute bundles.



6
7
8
# File 'lib/sekrit/config.rb', line 6

def bundles
  @bundles
end

#passphraseObject (readonly)

Returns the value of attribute passphrase.



9
10
11
# File 'lib/sekrit/config.rb', line 9

def passphrase
  @passphrase
end

#rawObject (readonly)

Returns the value of attribute raw.



11
12
13
# File 'lib/sekrit/config.rb', line 11

def raw
  @raw
end

#repoObject (readonly)

Returns the value of attribute repo.



10
11
12
# File 'lib/sekrit/config.rb', line 10

def repo
  @repo
end

#shared_filesObject (readonly)

Returns the value of attribute shared_files.



7
8
9
# File 'lib/sekrit/config.rb', line 7

def shared_files
  @shared_files
end