Class: Binpkgbot::Config
- Inherits:
-
Object
- Object
- Binpkgbot::Config
- Defined in:
- lib/binpkgbot/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #binds ⇒ Object
- #config_protect_mask ⇒ Object
- #config_protect_mask? ⇒ Boolean
- #emerge_options ⇒ Object
- #etc_portage ⇒ Object
-
#initialize(doc = {}) ⇒ Config
constructor
A new instance of Config.
- #portage_repo ⇒ Object
- #stage ⇒ Object
- #tasks ⇒ Object
- #use_sudo_for_nspawn? ⇒ Boolean
Constructor Details
#initialize(doc = {}) ⇒ Config
Returns a new instance of Config.
15 16 17 |
# File 'lib/binpkgbot/config.rb', line 15 def initialize(doc={}) @doc = Utils.symbolize_keys(doc) end |
Class Method Details
.from_yaml(yaml) ⇒ Object
7 8 9 |
# File 'lib/binpkgbot/config.rb', line 7 def self.from_yaml(yaml) new(YAML.load(yaml)) end |
.load_yaml(path) ⇒ Object
11 12 13 |
# File 'lib/binpkgbot/config.rb', line 11 def self.load_yaml(path) new(YAML.load_file(path)) end |
Instance Method Details
#binds ⇒ Object
35 36 37 |
# File 'lib/binpkgbot/config.rb', line 35 def binds @doc[:binds] end |
#config_protect_mask ⇒ Object
49 50 51 |
# File 'lib/binpkgbot/config.rb', line 49 def config_protect_mask @doc[:config_protect_mask] end |
#config_protect_mask? ⇒ Boolean
45 46 47 |
# File 'lib/binpkgbot/config.rb', line 45 def config_protect_mask? @doc.key?(:config_protect_mask) end |
#emerge_options ⇒ Object
31 32 33 |
# File 'lib/binpkgbot/config.rb', line 31 def @doc[:emerge_options] end |
#etc_portage ⇒ Object
23 24 25 |
# File 'lib/binpkgbot/config.rb', line 23 def etc_portage @doc[:etc_portage] end |
#portage_repo ⇒ Object
27 28 29 |
# File 'lib/binpkgbot/config.rb', line 27 def portage_repo @doc[:portage_repo] end |
#stage ⇒ Object
19 20 21 |
# File 'lib/binpkgbot/config.rb', line 19 def stage @doc[:stage] end |
#tasks ⇒ Object
39 40 41 42 43 |
# File 'lib/binpkgbot/config.rb', line 39 def tasks (@doc[:tasks] || []).map do |defi| Tasks.from_definition(defi, config: self) end end |
#use_sudo_for_nspawn? ⇒ Boolean
53 54 55 |
# File 'lib/binpkgbot/config.rb', line 53 def use_sudo_for_nspawn? @doc.fetch(:use_sudo_for_nspawn, false) end |