Class: ReleaseRobot::Printer
- Inherits:
-
Object
- Object
- ReleaseRobot::Printer
- Defined in:
- lib/release_robot/printer.rb
Constant Summary collapse
- PODIO_URL_REGEX =
/https:\/\/podio.com\/hranswerlink-8ee92nawfl\/issue-tracker\/apps\/product-feedback\/items\/\d+/
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#pull_requests ⇒ Object
Returns the value of attribute pull_requests.
Instance Method Summary collapse
-
#initialize(pull_requests, client) ⇒ Printer
constructor
A new instance of Printer.
- #podio_urls(repo_name, issue) ⇒ Object
- #print_all ⇒ Object
- #print_deploy_list ⇒ Object
- #print_prep_list ⇒ Object
- #print_title(title) ⇒ Object
Constructor Details
#initialize(pull_requests, client) ⇒ Printer
Returns a new instance of Printer.
7 8 9 10 |
# File 'lib/release_robot/printer.rb', line 7 def initialize(pull_requests, client) @pull_requests = pull_requests @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/release_robot/printer.rb', line 5 def client @client end |
#pull_requests ⇒ Object
Returns the value of attribute pull_requests.
5 6 7 |
# File 'lib/release_robot/printer.rb', line 5 def pull_requests @pull_requests end |
Instance Method Details
#podio_urls(repo_name, issue) ⇒ Object
55 56 57 58 |
# File 'lib/release_robot/printer.rb', line 55 def podio_urls(repo_name, issue) pr = client.pull_request(repo_name, issue.number) pr.body.scan PODIO_URL_REGEX end |
#print_all ⇒ Object
12 13 14 15 |
# File 'lib/release_robot/printer.rb', line 12 def print_all print_prep_list print_deploy_list end |
#print_deploy_list ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/release_robot/printer.rb', line 33 def print_deploy_list print_title 'List for #deploys' puts Date.today.strftime('%D') pull_requests.each_pair do |_, issues| issues.each do |(repo_name, issue)| slug = repo_name.gsub('MammothHR/', '') puts "(#{slug}) #{issue.title}" end end end |
#print_prep_list ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/release_robot/printer.rb', line 17 def print_prep_list print_title 'Prep list for #releases' puts "For today's release:\n\n" pull_requests.each_pair do |status, issues| issues.each do |(repo_name, issue)| puts issue.title puts issue.html_url podio_urls(repo_name, issue).each { |url| puts url } puts "*Build #{status}*" puts end end end |
#print_title(title) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/release_robot/printer.rb', line 47 def print_title(title) puts puts '-' * 50 puts title puts '-' * 50 puts end |