Class: DependencyWiring::Configuration

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/dependency_wiring/configuration.rb

Instance Method Summary collapse

Methods included from DSL

#deps, #git, #hg, #init, #mount

Constructor Details

#initialize(src_file, config = {}) ⇒ Configuration

Returns a new instance of Configuration.


7
8
9
10
# File 'lib/dependency_wiring/configuration.rb', line 7

def initialize(src_file, config={})
  @src_file = src_file
  @config = config
end

Instance Method Details

#load_dependenciesObject


12
13
14
15
# File 'lib/dependency_wiring/configuration.rb', line 12

def load_dependencies
  init()
  instance_eval(read(), @src_file)
end

#showObject


17
18
19
20
# File 'lib/dependency_wiring/configuration.rb', line 17

def show
  puts "Dependencies list"
  deps().each { |d| puts d }
end

#wire_allObject


22
23
24
25
26
27
28
# File 'lib/dependency_wiring/configuration.rb', line 22

def wire_all
  deps().each do |dep|
    puts "wiring #{dep}"
    dep.prepare_dest
    dep.wire
  end
end