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
e04f115f
Commit
e04f115f
authored
9 years ago
by
Xu Cheng
Browse files
Options
Downloads
Patches
Plain Diff
outdated: inline method
parent
27e184f5
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/cmd/outdated.rb
+7
-10
7 additions, 10 deletions
Library/Homebrew/cmd/outdated.rb
with
7 additions
and
10 deletions
Library/Homebrew/cmd/outdated.rb
+
7
−
10
View file @
e04f115f
...
...
@@ -3,10 +3,11 @@ require 'keg'
module
Homebrew
def
outdated
formulae
=
ARGV
.
resolved_formulae
.
any?
?
ARGV
.
resolved_formulae
:
Formula
.
installed
if
ARGV
.
json
==
"v1"
outdated
=
print_outdated_json
outdated
=
print_outdated_json
(
formulae
)
else
outdated
=
print_outdated
outdated
=
print_outdated
(
formulae
)
end
Homebrew
.
failed
=
ARGV
.
resolved_formulae
.
any?
&&
outdated
.
any?
end
...
...
@@ -34,14 +35,10 @@ module Homebrew
end
.
compact
end
def
formulae_to_check
ARGV
.
resolved_formulae
.
any?
?
ARGV
.
resolved_formulae
:
Formula
.
installed
end
def
print_outdated
def
print_outdated
(
formulae
)
verbose
=
(
$stdout
.
tty?
||
ARGV
.
verbose?
)
&&
!
ARGV
.
flag?
(
"--quiet"
)
outdated_brews
(
formulae
_to_check
)
do
|
f
,
versions
|
outdated_brews
(
formulae
)
do
|
f
,
versions
|
if
verbose
puts
"
#{
f
.
full_name
}
(
#{
versions
*
', '
}
<
#{
f
.
pkg_version
}
)"
else
...
...
@@ -50,9 +47,9 @@ module Homebrew
end
end
def
print_outdated_json
def
print_outdated_json
(
formulae
)
json
=
[]
outdated
=
outdated_brews
(
formulae
_to_check
)
do
|
f
,
versions
|
outdated
=
outdated_brews
(
formulae
)
do
|
f
,
versions
|
json
<<
{
:name
=>
f
.
name
,
:installed_versions
=>
versions
.
collect
(
&
:to_s
),
:current_version
=>
f
.
pkg_version
.
to_s
}
...
...
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