Class: Lampwick::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/lampwick/runner.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



3
4
5
# File 'lib/lampwick/runner.rb', line 3

def config
  @config
end

.namedObject

Returns the value of attribute named.



3
4
5
# File 'lib/lampwick/runner.rb', line 3

def named
  @named
end

.purgeObject

Returns the value of attribute purge.



3
4
5
# File 'lib/lampwick/runner.rb', line 3

def purge
  @purge
end

Class Method Details

.run!Object

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lampwick/runner.rb', line 7

def self.run!
  raise ArgumentError, "Need to have a config" if @config.empty?
  f = File.open(@config)
  config = YAML::load(f)
  git = Lampwick::Git.new(config)
  if @purge and !git.config.target.nil?
    puts "Purging #{git.config.target}"
    Dir.chdir git.config.target do
      FileUtils.rm_rf(".", :secure => true)
    end
  end
  git.update_or_clone
  git.populate_environments
  git.named_directories if @named and git.config.target
end