Class: LogicalConstruct::ConfigBuilder

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

Instance Method Summary collapse

Instance Method Details

#default_configuration(host) ⇒ Object



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

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

#defineObject



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

def define
  file target_path => [target_dir, valise.find("templates/" + source_path).full_path, Rake.application.rakefile] do
    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



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

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