Class: OctoMerge::InteractivePullRequests
- Inherits:
-
Object
- Object
- OctoMerge::InteractivePullRequests
- Defined in:
- lib/octo_merge/interactive_pull_requests.rb
Overview
TODO: Write specs
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(repo:, query:) ⇒ InteractivePullRequests
constructor
A new instance of InteractivePullRequests.
- #pull_requests ⇒ Object
Constructor Details
#initialize(repo:, query:) ⇒ InteractivePullRequests
Returns a new instance of InteractivePullRequests.
6 7 8 9 |
# File 'lib/octo_merge/interactive_pull_requests.rb', line 6 def initialize(repo:, query:) @repo = repo @query = query end |
Class Method Details
.get(options = {}) ⇒ Object
11 12 13 |
# File 'lib/octo_merge/interactive_pull_requests.rb', line 11 def self.get( = {}) new(repo: [:repo], query: [:query]).pull_requests end |
Instance Method Details
#pull_requests ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/octo_merge/interactive_pull_requests.rb', line 15 def pull_requests prs = list.all formatted_prs = prs.map do |pull_request| format_pull_request(pull_request) end system("clear") idx = Ask.checkbox "Select the pull requests you want to merge", formatted_prs idx.zip(prs).select { |e| e[0] }.map { |e| e[1][:number] }.join(",") end |