Module: Stage

Defined in:
lib/canuby/stage.rb

Overview

Staging related methods

Class Method Summary collapse

Class Method Details

.clean(project) ⇒ Object

Delete all staged files from a project



23
24
25
# File 'lib/canuby/stage.rb', line 23

def self.clean(project)
  const_get(project).outputs.each { |f| rm f if File.exist?(f) }
end

.collect(project, verbosity = 'm') ⇒ Object

Collect all stage files from a project



28
29
30
31
32
33
34
35
36
# File 'lib/canuby/stage.rb', line 28

def self.collect(project, verbosity = 'm')
  logger.info("Staging #{project}...") unless verbosity == 'q'
  Paths.create
  if const_get(project).output_dir.nil?
    const_get(project).outputs.map { |f| cp File.join(Paths.build_dir(project), ENV['rel_type'], f), Paths.stage_dir }
  else
    const_get(project).outputs.map { |f| cp File.join(const_get(project).output_dir, ENV['rel_type'], f), Paths.stage_dir }
  end
end