Class: Kachikachi::GitHub
- Inherits:
-
Object
- Object
- Kachikachi::GitHub
- Defined in:
- lib/kachikachi/git_hub.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
Instance Method Summary collapse
-
#initialize(options) ⇒ GitHub
constructor
A new instance of GitHub.
- #pull_requests ⇒ Object
Constructor Details
#initialize(options) ⇒ GitHub
Returns a new instance of GitHub.
8 9 10 |
# File 'lib/kachikachi/git_hub.rb', line 8 def initialize() @options = end |
Instance Attribute Details
#client=(value) ⇒ Object
Sets the attribute client
6 7 8 |
# File 'lib/kachikachi/git_hub.rb', line 6 def client=(value) @client = value end |
Instance Method Details
#pull_requests ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/kachikachi/git_hub.rb', line 12 def pull_requests pull_request_numbers = @options['pull-request-numbers'] return pull_request_numbers.map { |number| PullRequest.new(number, @options) } if pull_request_numbers = { state: @options[:state] } [:creator] = @options[:user] if @options[:user] issues = milestone_numbers.map { |number| [:milestone] = number client.list_issues(@options[:repo], ).select(&:pull_request) }.flatten issues.map{ |issue| PullRequest.new(issue.number, @options) }.select{ |pr| pr.base.ref == @options['base-branch'] } end |