Class: Michael::Commands::Repos::PullRequests
- Inherits:
-
Models::Guard
- Object
- Michael::Command
- Models::Guard
- Michael::Commands::Repos::PullRequests
- Defined in:
- lib/michael/commands/repos/pull_requests.rb
Instance Attribute Summary
Attributes inherited from Models::Guard
Instance Method Summary collapse
- #execute(out: $stdout) ⇒ Object
-
#initialize(options) ⇒ PullRequests
constructor
A new instance of PullRequests.
Methods inherited from Michael::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #pastel, #platform, #prompt, #screen, #spinner, #which
Constructor Details
#initialize(options) ⇒ PullRequests
Returns a new instance of PullRequests.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/michael/commands/repos/pull_requests.rb', line 16 def initialize() super() @prs = Michael::Models::Github::PullRequest.new @user = Michael::Models::Github::User.new @repos = repos_config.fetch(:repos) abort 'No repositories configured' if @repos.nil? || @repos.empty? = end |
Instance Method Details
#execute(out: $stdout) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/michael/commands/repos/pull_requests.rb', line 27 def execute(out: $stdout) list = get_repos_with_spinner(out) print_good_prs(out, repos_with_prs(list)) print_repos_w_no_prs(out, repos_no_prs(list)) if [:show_empty] print_broken_repos(out, list.select { |item| item[:state] == :failed }) end |