Module: Kernel

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

Instance Method Summary collapse

Instance Method Details

#debug(msg) ⇒ Object

todo: replace with logger



490
491
492
# File 'lib/rscm/scm/perforce.rb', line 490

def debug(msg)
  #puts msg
end

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

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



481
482
483
484
485
486
487
# File 'lib/rscm/scm/perforce.rb', line 481

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