Module: App
Defined Under Namespace
Classes: Hashy
Instance Attribute Summary collapse
-
#machine_configs ⇒ Object
Returns the value of attribute machine_configs.
-
#root ⇒ Object
Returns the value of attribute root.
-
#seeds ⇒ Object
Returns the value of attribute seeds.
Instance Method Summary collapse
Instance Attribute Details
#machine_configs ⇒ Object
Returns the value of attribute machine_configs.
6 7 8 |
# File 'lib/sources/project/new/lib/app.rb', line 6 def machine_configs @machine_configs end |
#root ⇒ Object
Returns the value of attribute root.
6 7 8 |
# File 'lib/sources/project/new/lib/app.rb', line 6 def root @root end |
#seeds ⇒ Object
Returns the value of attribute seeds.
6 7 8 |
# File 'lib/sources/project/new/lib/app.rb', line 6 def seeds @seeds end |
Instance Method Details
#load_machines!(config) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/sources/project/new/lib/app.rb', line 45 def load_machines!( config ) Dir[ "#{ root }/machines/**/**.vagrant.rb" ].each do | machine | load machine end machines = if ENV[ 'MACHINES' ] ENV[ 'MACHINES' ].split ',' else machine_configs.keys end machines.each do | machine | if machine_config = machine_configs[ machine ] instance_exec config , &machine_config end end end |
#load_seed!(seed) ⇒ Object
33 34 35 36 37 |
# File 'lib/sources/project/new/lib/app.rb', line 33 def load_seed!( seed ) seed_name = seed.split( '/' ).last.split( '.' ).first data = YAML.load_file seed seeds[ seed_name ] = data end |
#load_seeds! ⇒ Object
39 40 41 42 43 |
# File 'lib/sources/project/new/lib/app.rb', line 39 def load_seeds! Dir[ "#{ root }/seeds/**/**.seed.yml" ].each do | seed | load_seed! seed end end |