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
bc143bb4
Commit
bc143bb4
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Support `audit` for multilingual casks.
parent
bc2d676b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/cask/lib/hbc/auditor.rb
+18
-0
18 additions, 0 deletions
Library/Homebrew/cask/lib/hbc/auditor.rb
Library/Homebrew/cask/lib/hbc/dsl.rb
+7
-2
7 additions, 2 deletions
Library/Homebrew/cask/lib/hbc/dsl.rb
with
25 additions
and
2 deletions
Library/Homebrew/cask/lib/hbc/auditor.rb
+
18
−
0
View file @
bc143bb4
module
Hbc
class
Auditor
def
self
.
audit
(
cask
,
audit_download:
false
,
check_token_conflicts:
false
)
saved_languages
=
MacOS
.
instance_variable_get
(
:@languages
)
if
languages_blocks
=
cask
.
instance_variable_get
(
:@dsl
).
instance_variable_get
(
:@language_blocks
)
languages_blocks
.
keys
.
map
(
&
:first
).
each
do
|
language
|
ohai
"Auditing language
#{
language
.
to_s
}
"
language
=
"en-US"
if
language
==
:default
MacOS
.
instance_variable_set
(
:@languages
,
[
language
])
audit_cask_instance
(
Hbc
.
load
(
cask
.
sourcefile_path
),
audit_download
,
check_token_conflicts
)
CLI
::
Cleanup
.
run
(
cask
.
token
)
if
audit_download
end
else
audit_cask_instance
(
cask
,
audit_download
,
check_token_conflicts
)
end
ensure
MacOS
.
instance_variable_set
(
:@languages
,
saved_languages
)
end
def
self
.
audit_cask_instance
(
cask
,
audit_download
,
check_token_conflicts
)
download
=
audit_download
&&
Download
.
new
(
cask
)
audit
=
Audit
.
new
(
cask
,
download:
download
,
check_token_conflicts:
check_token_conflicts
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/cask/lib/hbc/dsl.rb
+
7
−
2
View file @
bc143bb4
...
...
@@ -122,8 +122,13 @@ module Hbc
regexes_or_strings
=
regexes_or_strings
-
[
:default
]
+
[
%r{^en}
]
end
case
language
when
*
regexes_or_strings
regexes_or_strings
.
each
do
|
regex_or_string
|
if
regex_or_string
.
class
==
language
.
class
next
unless
regex_or_string
==
language
else
next
unless
regex_or_string
=~
language
end
@language
=
block
.
call
return
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