Class: Toolshed::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/toolshed/base.rb

Class Method Summary collapse

Class Method Details

.wait_for_command(command, seconds = 10) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/toolshed/base.rb', line 3

def self.wait_for_command(command, seconds=10)
  begin
    Timeout::timeout(seconds) {
      until (system(command))
        sleep 1
      end
      return
    }
  rescue Timeout::Error => e
    puts "Unable to execute command after #{seconds} seconds"
    return
  end
end