Class: Buildbox::Monitor

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/buildbox/monitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(build, api) ⇒ Monitor

Returns a new instance of Monitor.



8
9
10
11
# File 'lib/buildbox/monitor.rb', line 8

def initialize(build, api)
  @build = build
  @api   = api
end

Instance Method Details

#monitorObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/buildbox/monitor.rb', line 13

def monitor
  loop do
    @api.update_build(@build) if @build.started?

    if @build.finished?
      break
    else
      sleep 1
    end
  end
end