Class: CircleCI::CLI::Command::BuildWatcher
- Inherits:
-
Object
- Object
- CircleCI::CLI::Command::BuildWatcher
- Defined in:
- lib/circleci/cli/command/watch_command/build_watcher.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
Instance Method Summary collapse
-
#initialize(build, verbose: false) ⇒ BuildWatcher
constructor
A new instance of BuildWatcher.
- #start ⇒ Object
- #stop(status) ⇒ Object
Constructor Details
#initialize(build, verbose: false) ⇒ BuildWatcher
Returns a new instance of BuildWatcher.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/circleci/cli/command/watch_command/build_watcher.rb', line 9 def initialize(build, verbose: false) @build = build @verbose = verbose = Hash.new { |h, k| h[k] = [] } @build_thread = nil @steps = build.steps @current_step = nil @read_byte = 0 end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
7 8 9 |
# File 'lib/circleci/cli/command/watch_command/build_watcher.rb', line 7 def build @build end |
Instance Method Details
#start ⇒ Object
21 22 23 24 |
# File 'lib/circleci/cli/command/watch_command/build_watcher.rb', line 21 def start poll_build notify_started end |
#stop(status) ⇒ Object
26 27 28 29 30 |
# File 'lib/circleci/cli/command/watch_command/build_watcher.rb', line 26 def stop(status) update_build @build_thread&.kill notify_stopped(status) end |