Class: OttInfra::CodeReview

Inherits:
Object
  • Object
show all
Defined in:
lib/ottinfra/codereview.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCodeReview

Returns a new instance of CodeReview.



8
9
10
# File 'lib/ottinfra/codereview.rb', line 8

def initialize
  @g = Git.open( find_git_root )
end

Class Method Details

.runObject



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

def self.run
  codereview = self.new
  review = codereview.get_review_info
  unless review[:reviewers].nil?
    OttInfra::SendMail.new.send(
      review[:reviewers],
      subject: "CodeReview",
      message: "Message",
      attach: [review[:patch]] )
  end
end

Instance Method Details

#get_review_infoObject



24
25
26
27
28
29
30
# File 'lib/ottinfra/codereview.rb', line 24

def get_review_info
  {
    :author => get_author,
    :reviewers => get_reviewers,
    :patch => get_patch
  }
end