Module: Pwrake::BranchApplication

Included in:
Rake::Application
Defined in:
lib/pwrake/branch/branch_application.rb

Overview

The TaskManager module is a mixin for managing tasks.

Instance Method Summary collapse

Instance Method Details

#run_branch(r, w) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pwrake/branch/branch_application.rb', line 9

def run_branch(r,w)
  init("pwrake_branch")
  opts = Marshal.load(r)
  if !opts.kind_of?(Hash)
    raise "opts is not a Hash: opts=#{opts.inspect}"
  end
  @branch = Branch.new(opts,r,w)
  opts.feedback_options
  load_rakefile
  w.puts "pwrake_branch start"
  w.flush
  begin
    @branch.run
  rescue => e
    Log.fatal e
    $stderr.puts e
    $stderr.puts e.backtrace
    @branch.kill
  ensure
    @branch.finish
  end
end

#run_branch_in_thread(r, w, opts) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/pwrake/branch/branch_application.rb', line 32

def run_branch_in_thread(r,w,opts)
  @branch = Branch.new(opts,r,w)
  begin
    @branch.run
  rescue => e
    Log.fatal e
    $stderr.puts e
    $stderr.puts e.backtrace
    @branch.kill
  ensure
    @branch.finish
  end
end