Class: Piperun::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/piperun/project.rb

Defined Under Namespace

Classes: DSL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProject

Returns a new instance of Project.



5
6
7
# File 'lib/piperun/project.rb', line 5

def initialize
  @pipelines = []
end

Instance Attribute Details

#pipelinesObject (readonly)

Returns the value of attribute pipelines.



3
4
5
# File 'lib/piperun/project.rb', line 3

def pipelines
  @pipelines
end

Class Method Details

.build(&block) ⇒ Object



13
14
15
16
17
18
# File 'lib/piperun/project.rb', line 13

def self.build(&block)
  pipe = new
  dsl = DSL.new(pipe)
  dsl.instance_eval(&block)
  pipe
end

.load(filename) ⇒ Object



20
21
22
23
24
25
# File 'lib/piperun/project.rb', line 20

def self.load(filename)
  pipe = new
  dsl = DSL.new(pipe)
  dsl.instance_eval(File.read(filename), filename)
  pipe
end

Instance Method Details

#add_pipeline(p) ⇒ Object



9
10
11
# File 'lib/piperun/project.rb', line 9

def add_pipeline(p)
  @pipelines << p
end

#runObject



37
38
39
40
41
# File 'lib/piperun/project.rb', line 37

def run
  @pipelines.each do |p|
    p.run
  end
end

#watchObject



43
44
45
46
47
# File 'lib/piperun/project.rb', line 43

def watch
  @pipelines.each do |p|
    p.watch
  end
end