Top Level Namespace

Defined Under Namespace

Modules: GitConfig, Instigator Classes: App, Github, Haskell, Jenkins, Rails, Sinatra

Instance Method Summary collapse

Instance Method Details

#announce(str) ⇒ Object



4
5
6
# File 'lib/instigator/util.rb', line 4

def announce(str)
  puts "    #{str}"
end

#guarded(task) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/instigator/util.rb', line 8

def guarded(task)
  pid, stdin, stdout, stderr = Open4.popen4 task
  ignored, status = Process.waitpid2 pid
 
  if status == 0
    stderr.read
    stdout.read
  else
    err = { :status => status, :stdout => stdout.read, :stderr => stderr.read }
    if block_given?
      yield err
    else
      abort "bad exit:\n#{ap err}"
    end
  end
  
end