Module: TachikomaAi::TachikomaExtention

Defined in:
lib/tachikoma_ai/tachikoma_extention.rb

Instance Method Summary collapse

Instance Method Details

#pull_requestObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tachikoma_ai/tachikoma_extention.rb', line 12

def pull_request
  @pull_request_body = @pull_request_body.to_s
  if @strategy
    Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
      @pull_request_body += "\n\n" + @strategy.pull_request_body
    end
  end
rescue
  p $ERROR_INFO
ensure
  super
end

#run(strategy) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/tachikoma_ai/tachikoma_extention.rb', line 3

def run(strategy)
  begin
    @strategy = TachikomaAi::Strategies.const_get(strategy.capitalize).new
  rescue NameError
    raise LoadError, "Could not find matching strategy for #{strategy}."
  end
  super
end