Class: Linterbot::TTYPullRequestCommenter

Inherits:
Object
  • Object
show all
Defined in:
lib/linterbot/tty_pull_request_commenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, pull_request_number, github_client) ⇒ TTYPullRequestCommenter

Returns a new instance of TTYPullRequestCommenter.



8
9
10
11
# File 'lib/linterbot/tty_pull_request_commenter.rb', line 8

def initialize(repository, pull_request_number, github_client)
  @repository = repository
  @pull_request_number = pull_request_number
end

Instance Attribute Details

#pull_request_numberObject

Returns the value of attribute pull_request_number.



6
7
8
# File 'lib/linterbot/tty_pull_request_commenter.rb', line 6

def pull_request_number
  @pull_request_number
end

#repositoryObject

Returns the value of attribute repository.



5
6
7
# File 'lib/linterbot/tty_pull_request_commenter.rb', line 5

def repository
  @repository
end

Instance Method Details

#publish_comment(comment) ⇒ Object



13
14
15
16
17
18
# File 'lib/linterbot/tty_pull_request_commenter.rb', line 13

def publish_comment(comment)
  puts "#{repository}##{pull_request_number}"
  puts "#{comment.sha} - #{comment.file}"
  puts "#{comment.severity} - #{comment.message}"
  puts ""
end

#publish_summary(summary) ⇒ Object



20
21
22
# File 'lib/linterbot/tty_pull_request_commenter.rb', line 20

def publish_summary(summary)
  puts summary
end