Sha256: d8b7333312d9200a0aa464675d538fcacf8daa3b607f8e7aaf890f0743f580ae

Contents?: true

Size: 336 Bytes

Versions: 2

Compression:

Stored size: 336 Bytes

Contents

module Frankenpins
  module Utils
    #Prevents the main thread from exiting. Required when using PiPiper.watch
    def wait
      loop do sleep 1 end
    end

    def watch(&block)
      Thread.new do
        loop do
          wait_for_change
          block.call(self)
        end
      end.abort_on_exception = true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frankenpins-0.3.0 lib/frankenpins/utils.rb
frankenpins-0.2.1 lib/frankenpins/utils.rb