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
dc1bbe7f
Commit
dc1bbe7f
authored
4 years ago
by
Elizabeth Tackett
Browse files
Options
Downloads
Patches
Plain Diff
handle requests for multiple formulae
parent
388b0ae8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/dev-cmd/bump.rb
+26
-8
26 additions, 8 deletions
Library/Homebrew/dev-cmd/bump.rb
Library/Homebrew/utils/repology.rb
+0
-1
0 additions, 1 deletion
Library/Homebrew/utils/repology.rb
with
26 additions
and
9 deletions
Library/Homebrew/dev-cmd/bump.rb
+
26
−
8
View file @
dc1bbe7f
...
@@ -23,21 +23,39 @@ module Homebrew
...
@@ -23,21 +23,39 @@ module Homebrew
def
bump
def
bump
args
=
bump_args
.
parse
args
=
bump_args
.
parse
requested_formula
=
args
.
formulae
.
first
.
to_s
if
args
.
formulae
.
first
requested_formulae
=
!
args
.
formulae
.
empty?
?
args
.
formulae
.
map
(
&
:name
)
:
nil
requested_limit
=
args
.
limit
.
to_i
if
args
.
limit
.
present?
requested_limit
=
args
.
limit
.
to_i
if
args
.
limit
.
present?
raise
FormulaUnavailableError
,
requested_formula
if
requested_formula
&&
!
validate_formula
(
requested_formula
)
repology_data
=
if
requested_formulae
response
=
{}
requested_formulae
.
each
do
|
formula
|
raise
FormulaUnavailableError
,
formula
unless
validate_formula
(
formula
)
package_data
=
Repology
.
single_package_query
(
formula
)
response
[
package_data
.
keys
.
first
]
=
package_data
.
values
.
first
if
package_data
end
repology_data
=
if
requested_formula
response
Repology
.
single_package_query
(
requested_formula
)
else
else
Repology
.
parse_api_response
Repology
.
parse_api_response
end
end
validated_formulae
=
if
repology_data
.
blank?
validated_formulae
=
{}
{
requested_formula
.
to_s
=>
Repology
.
format_package
(
requested_formula
,
nil
)
}
else
validated_formulae
=
Repology
.
validate_and_format_packages
(
repology_data
,
requested_limit
)
if
repology_data
Repology
.
validate_and_format_packages
(
repology_data
,
requested_limit
)
if
requested_formulae
repology_excluded_formulae
=
requested_formulae
.
reject
do
|
formula
|
repology_data
[
formula
]
end
formulae
=
{}
repology_excluded_formulae
.
each
do
|
formula
|
formulae
[
formula
]
=
Repology
.
format_package
(
formula
,
nil
)
end
formulae
.
each
{
|
formula
,
data
|
validated_formulae
[
formula
]
=
data
}
end
end
display
(
validated_formulae
)
display
(
validated_formulae
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/utils/repology.rb
+
0
−
1
View file @
dc1bbe7f
...
@@ -58,7 +58,6 @@ module Repology
...
@@ -58,7 +58,6 @@ module Repology
packages
=
{}
packages
=
{}
outdated_repology_packages
.
each
do
|
_name
,
repositories
|
outdated_repology_packages
.
each
do
|
_name
,
repositories
|
# identify homebrew repo
repology_homebrew_repo
=
repositories
.
find
do
|
repo
|
repology_homebrew_repo
=
repositories
.
find
do
|
repo
|
repo
[
"repo"
]
==
"homebrew"
repo
[
"repo"
]
==
"homebrew"
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