Class: LogicalConstruct::ConfigBuilder

Inherits:
Mattock::TaskLib
  • Object
show all
Includes:
Mattock::DeferredDefinition, Mattock::TemplateHost
Defined in:
lib/logical-construct/ground-control/setup/build-files.rb

Instance Method Summary collapse

Instance Method Details

#default_configuration(host) ⇒ Object



19
20
21
22
# File 'lib/logical-construct/ground-control/setup/build-files.rb', line 19

def default_configuration(host)
  super
  host.copy_settings_to(self)
end

#defineObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/logical-construct/ground-control/setup/build-files.rb', line 30

def define
  file target_path => [target_dir, valise.find("templates/" + source_path).full_path, Rake.application.rakefile] do
    finalize_configuration
    p extra
    File::open(target_path, "w") do |file|
      file.write render(source_path)
    end
  end
  file target_path => target_dir
  task :local_setup => target_path
end

#resolve_configurationObject



24
25
26
27
28
# File 'lib/logical-construct/ground-control/setup/build-files.rb', line 24

def resolve_configuration
  self.target_path ||= fail_unless_set(:target_dir) && File::join(target_dir, base_name)
  self.source_path ||= fail_unless_set(:base_name)  && "#{base_name}.erb"
  super
end