Class: Boxes::Config
- Inherits:
-
Object
- Object
- Boxes::Config
- Defined in:
- lib/boxes/config.rb
Overview
Stores the configuration for Boxes.
Constant Summary collapse
- DEFAULTS =
The default settings for the configuration.
{ environment_vars: [ { 'PACKER_CACHE_DIR' => ( Pathname.new(ENV['BOXES_HOME_DIR'] || '~/.boxes' ). + 'packer_cache') } ], template_paths: [ # the gem install directory File.('../../../templates', __FILE__) ], script_paths: [ # the gem install directory File.('../../../scripts', __FILE__) ] }
Instance Attribute Summary collapse
-
#environment_vars ⇒ Object
A Hash of environment variables Boxes sets in the run environment.
-
#script_paths ⇒ Object
Paths known to boxes for discovering scripts.
-
#template_paths ⇒ Object
Paths known to boxes for discovering templates.
Instance Method Summary collapse
-
#home_dir ⇒ Object
The directory which boxes works out of.
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#working_dir ⇒ Object
The directory inside the ‘home_dir` which boxes runs builds inside of.
Constructor Details
Instance Attribute Details
#environment_vars ⇒ Object
A Hash of environment variables Boxes sets in the run environment.
40 41 42 |
# File 'lib/boxes/config.rb', line 40 def environment_vars @environment_vars end |
#script_paths ⇒ Object
Paths known to boxes for discovering scripts.
37 38 39 |
# File 'lib/boxes/config.rb', line 37 def script_paths @script_paths end |
#template_paths ⇒ Object
Paths known to boxes for discovering templates.
34 35 36 |
# File 'lib/boxes/config.rb', line 34 def template_paths @template_paths end |
Instance Method Details
#home_dir ⇒ Object
The directory which boxes works out of.
22 23 24 25 |
# File 'lib/boxes/config.rb', line 22 def home_dir @home_dir ||= Pathname.new( ENV['BOXES_HOME_DIR'] || '~/.boxes'). end |
#working_dir ⇒ Object
The directory inside the ‘home_dir` which boxes runs builds inside of.
28 29 30 31 |
# File 'lib/boxes/config.rb', line 28 def working_dir @working_dir ||= Pathname.new( ENV['BOXES_WORKING_DIR'] || home_dir + 'tmp'). end |