Class: Percheron::Config
- Inherits:
-
Object
- Object
- Percheron::Config
- Includes:
- Singleton
- Defined in:
- lib/percheron/config.rb
Constant Summary collapse
- DEFAULT_CONFIG_FILE =
'.percheron.yml'
- @@file =
rubocop:disable Style/ClassVars
Pathname.new(DEFAULT_CONFIG_FILE).
Class Method Summary collapse
- .docker ⇒ Object
- .file_base_path ⇒ Object
-
.load!(file) ⇒ Object
rubocop:enable Style/ClassVars.
- .secrets ⇒ Object
-
.stacks ⇒ Object
rubocop:enable Style/ClassVars.
- .userdata ⇒ Object
Instance Method Summary collapse
- #docker ⇒ Object
- #file_base_path ⇒ Object
-
#load!(file) ⇒ Object
rubocop:disable Style/ClassVars.
- #secrets ⇒ Object
- #stacks ⇒ Object
- #userdata ⇒ Object
Class Method Details
.docker ⇒ Object
58 59 60 |
# File 'lib/percheron/config.rb', line 58 def self.docker instance.docker end |
.file_base_path ⇒ Object
34 35 36 |
# File 'lib/percheron/config.rb', line 34 def self.file_base_path instance.file_base_path end |
.load!(file) ⇒ Object
rubocop:enable Style/ClassVars
14 15 16 |
# File 'lib/percheron/config.rb', line 14 def self.load!(file) instance.load!(file) end |
.secrets ⇒ Object
42 43 44 |
# File 'lib/percheron/config.rb', line 42 def self.secrets instance.secrets end |
.stacks ⇒ Object
rubocop:enable Style/ClassVars
26 27 28 |
# File 'lib/percheron/config.rb', line 26 def self.stacks instance.stacks end |
.userdata ⇒ Object
50 51 52 |
# File 'lib/percheron/config.rb', line 50 def self.userdata instance.userdata end |
Instance Method Details
#docker ⇒ Object
62 63 64 |
# File 'lib/percheron/config.rb', line 62 def docker contents.docker end |
#file_base_path ⇒ Object
38 39 40 |
# File 'lib/percheron/config.rb', line 38 def file_base_path file.dirname end |
#load!(file) ⇒ Object
rubocop:disable Style/ClassVars
19 20 21 22 23 |
# File 'lib/percheron/config.rb', line 19 def load!(file) @@file = Pathname.new(file). invalidate_memoised_values! self end |
#secrets ⇒ Object
46 47 48 |
# File 'lib/percheron/config.rb', line 46 def secrets secrets_file ? Hashie::Mash.new(YAML.load_file(secrets_file)) : {} end |
#stacks ⇒ Object
30 31 32 |
# File 'lib/percheron/config.rb', line 30 def stacks @stacks ||= process_stacks! end |
#userdata ⇒ Object
54 55 56 |
# File 'lib/percheron/config.rb', line 54 def userdata contents.userdata || {} end |