Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
5439813c
Commit
5439813c
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Extract method in Github module
parent
863e1a3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/utils.rb
+11
-11
11 additions, 11 deletions
Library/Homebrew/utils.rb
with
11 additions
and
11 deletions
Library/Homebrew/utils.rb
+
11
−
11
View file @
5439813c
...
...
@@ -271,6 +271,11 @@ module GitHub extend self
end
end
def
each_issue_matching
(
query
,
&
block
)
uri
=
URI
.
parse
(
"https://api.github.com/legacy/issues/search/mxcl/homebrew/open/
#{
query
}
"
)
open
(
uri
)
{
|
f
|
Utils
::
JSON
.
load
(
f
.
read
)[
'issues'
].
each
(
&
block
)
}
end
def
issues_for_formula
name
# bit basic as depends on the issue at github having the exact name of the
# formula in it. Which for stuff like objective-caml is unlikely. So we
...
...
@@ -280,13 +285,9 @@ module GitHub extend self
issues
=
[]
uri
=
URI
.
parse
(
"https://api.github.com/legacy/issues/search/mxcl/homebrew/open/
#{
name
}
"
)
GitHub
.
open
uri
do
|
f
|
Utils
::
JSON
.
load
(
f
.
read
)[
'issues'
].
each
do
|
issue
|
# don't include issues that just refer to the tool in their body
issues
<<
issue
[
'html_url'
]
if
issue
[
'title'
].
include?
name
end
each_issue_matching
(
name
)
do
|
issue
|
# don't include issues that just refer to the tool in their body
issues
<<
issue
[
'html_url'
]
if
issue
[
'title'
].
include?
name
end
issues
...
...
@@ -294,11 +295,10 @@ module GitHub extend self
def
find_pull_requests
rx
query
=
rx
.
source
.
delete
(
'.*'
).
gsub
(
'\\'
,
''
)
uri
=
URI
.
parse
(
"https://api.github.com/legacy/issues/search/mxcl/homebrew/open/
#{
query
}
"
)
GitHub
.
open
uri
do
|
f
|
Utils
::
JSON
.
load
(
f
.
read
)[
'issues'
].
each
do
|
pull
|
yield
pull
[
'pull_request_url'
]
if
rx
.
match
pull
[
'title'
]
and
pull
[
'pull_request_url'
]
each_issue_matching
(
query
)
do
|
issue
|
if
rx
===
issue
[
'title'
]
&&
issue
.
has_key?
(
'pull_request_url'
)
yield
issue
[
'pull_request_url'
]
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment