module Frankenpins::Utils

Public Instance Methods

wait() click to toggle source

Prevents the main thread from exiting. Required when using PiPiper.watch

# File lib/frankenpins/utils.rb, line 4
def wait
  loop do sleep 1 end
end
watch(&block) click to toggle source
# File lib/frankenpins/utils.rb, line 8
def watch(&block)
  Thread.new do
    loop do
      wait_for_change
      block.call(self)
    end
  end.abort_on_exception = true
end