class Ruboty::Actions::CheckPrPlease
Public Instance Methods
call()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 4 def call message.reply(begging_message) end
Private Instance Methods
access_token()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 14 def access_token @access_token ||= ENV['GITHUB_ACCESS_TOKEN'] end
begging_message()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 26 def begging_message return unless unchecked.present? str = "#{label} の Pull Request が #{unchecked.count} 件あります!!、!\n>>> " unchecked.each do |pr| str << "#{pr.title} #{pr.pull_request.html_url}\n" end str.chomp end
client()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 10 def client @client ||= ::Octokit::Client.new(access_token: access_token) end
label()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 22 def label @label ||= message[:label].strip end
repository()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 18 def repository @repository ||= (message[:repo] || ENV['GITHUB_REPOSITORY']).strip end
unchecked()
click to toggle source
# File lib/ruboty/actions/check_pr_please.rb, line 35 def unchecked client.issues(repository, labels: label) end