lib/whatsup_github/pulls.rb in whatsup_github-1.0.0 vs lib/whatsup_github/pulls.rb in whatsup_github-1.0.1
- old
+ new
@@ -16,11 +16,15 @@
end
def data
pull_requests = []
filtered_numbers.each do |number|
- pull_requests << client.pull_request(@repo, number)
+ pull_requests << if @repo.start_with? 'enterprise:'
+ enterprise_client.pull_request(@repo, number)
+ else
+ client.pull_request(@repo, number)
+ end
end
pull_requests
end
private
@@ -65,19 +69,13 @@
end
def call_query(query)
puts "Searching on GitHub by query #{query}"
if repo.start_with? 'enterprise:'
- enterprise_client.search_issues(
- enterprise_query(query)
- )
+ enterprise_client.search_issues(query)
else
client.search_issues(query)
end
- end
-
- def enterprise_query(query)
- query.gsub('enterprise:', '')
end
def query(label)
"repo:#{repo} label:\"#{label}\" merged:>=#{since} base:#{base_branch} is:pull-request"
end