Module: Kernel

Defined in:
lib/rscm/scm/perforce.rb

Instance Method Summary collapse

Instance Method Details

#debug(msg) ⇒ Object

todo: replace with logger



484
485
486
# File 'lib/rscm/scm/perforce.rb', line 484

def debug(msg)
  #puts msg
end

#timeout(attempts = 5, &proc) ⇒ Object

TODO: use Ruby’s built-in timeout? (require ‘timeout’)



475
476
477
478
479
480
481
# File 'lib/rscm/scm/perforce.rb', line 475

def timeout(attempts=5, &proc)
  0.upto(attempts) do
    sleep 1
    return false if proc.call
  end
  true
end