Module: Pwrake::BranchApplication

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

#loggerObject



6
7
8
# File 'lib/pwrake/branch/branch_application.rb', line 6

def logger
  @branch.logger
end

#run_branch(r, w) ⇒ Object



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

def run_branch(r,w)
  #standard_exception_handling do
    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)
    @branch.init_logger
    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
end

#run_branch_in_thread(r, w, opts) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/pwrake/branch/branch_application.rb', line 36

def run_branch_in_thread(r,w,opts)
  #standard_exception_handling do
    @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
end