Class: RextractApp

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
bin/rextract

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#job_nameObject

Returns the value of attribute job_name.



11
12
13
# File 'bin/rextract', line 11

def job_name
  @job_name
end

Class Method Details

.source_rootObject



13
14
15
# File 'bin/rextract', line 13

def self.source_root
  File.dirname(__FILE__) + "/../templates"
end

Instance Method Details

#create_job(project_name, job_name) ⇒ Object



33
34
35
36
37
# File 'bin/rextract', line 33

def create_job(project_name, job_name)
  @job_name = job_name # hack for template parsing and interpolation
  puts "creating #{job_name} job"
  directory("job", "#{project_name}/#{job_name}")
end

#job(job_name) ⇒ Object



40
41
42
# File 'bin/rextract', line 40

def job(job_name)
  create_job(job_name)
end

#project(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'bin/rextract', line 19

def project(name)
  jobs = options[:jobs]
  jobs = jobs.split(",").map(&:strip)
  puts "create project #{name}"
  empty_directory(name)
  template('app/run', "#{name}/run")
  chmod("#{name}/run", 0744)
 
 jobs.each do |job_name|
    create_job(name, job_name)
  end
end