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
f52116cd
Commit
f52116cd
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Add `language` stanza to cask DSL.
parent
929c594f
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/dsl.rb
+26
-0
26 additions, 0 deletions
Library/Homebrew/cask/lib/hbc/dsl.rb
Library/Homebrew/cask/lib/hbc/dsl/base.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/cask/lib/hbc/dsl/base.rb
with
27 additions
and
1 deletion
Library/Homebrew/cask/lib/hbc/dsl.rb
+
26
−
0
View file @
f52116cd
...
...
@@ -64,6 +64,7 @@ module Hbc
:depends_on
,
:gpg
,
:homepage
,
:language
,
:license
,
:name
,
:sha256
,
...
...
@@ -98,6 +99,31 @@ module Hbc
@homepage
||=
homepage
end
def
language
(
*
args
,
&
block
)
@language
||=
{}
if
!
args
.
empty?
&&
block_given?
args
.
each
do
|
arg
|
MacOS
.
languages
.
each_with_index
do
|
l
,
index
|
string_or_regex
=
arg
==
:default
?
%r{^en}
:
arg
next
unless
l
.
match
(
string_or_regex
)
next
unless
@language
[
:level
].
nil?
||
@language
[
:level
]
>
index
@language
=
{
block:
block
,
level:
index
,
}
end
end
if
args
.
include?
(
:default
)
# :default has to be the last language block in order to assign return value of the selected `language` block to `@language`
@language
=
@language
[
:block
].
call
end
else
@language
end
end
def
url
(
*
args
,
&
block
)
url_given
=
!
args
.
empty?
||
block_given?
return
@url
unless
url_given
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/cask/lib/hbc/dsl/base.rb
+
1
−
1
View file @
f52116cd
...
...
@@ -8,7 +8,7 @@ module Hbc
@command
=
command
end
def_delegators
:@cask
,
:token
,
:version
,
:caskroom_path
,
:staged_path
,
:appdir
def_delegators
:@cask
,
:token
,
:version
,
:caskroom_path
,
:staged_path
,
:appdir
,
:language
def
system_command
(
executable
,
options
=
{})
@command
.
run!
(
executable
,
options
)
...
...
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