parent
3ef9d9eca1
commit
25f7cfee04
|
@ -31,7 +31,7 @@ Making a Cask is easy: a Cask is a small Ruby file.
|
||||||
Here’s a Cask for `shuttle` as an example. Note that the `url` stanza uses `#{version}` ([string interpolation](https://en.wikipedia.org/wiki/String_interpolation#Ruby)) to create a Cask that only needs `version` and `sha256` changes when updated.
|
Here’s a Cask for `shuttle` as an example. Note that the `url` stanza uses `#{version}` ([string interpolation](https://en.wikipedia.org/wiki/String_interpolation#Ruby)) to create a Cask that only needs `version` and `sha256` changes when updated.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'shuttle' do
|
cask 'shuttle' do
|
||||||
version '1.2.5'
|
version '1.2.5'
|
||||||
sha256 '7df182f506b80011222c0cdd470be76e0376f38e331f3fafbb6af9add3578023'
|
sha256 '7df182f506b80011222c0cdd470be76e0376f38e331f3fafbb6af9add3578023'
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ end
|
||||||
Here is another Cask for `genymotion`. Note that you may repeat the `app` stanza as many times as you need, to define multiple apps:
|
Here is another Cask for `genymotion`. Note that you may repeat the `app` stanza as many times as you need, to define multiple apps:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'genymotion' do
|
cask 'genymotion' do
|
||||||
version '2.6.0'
|
version '2.6.0'
|
||||||
sha256 '9d12ae904761d76b15a556262d7eb32d1f5031fe60690224d7b0a70303cf8d39'
|
sha256 '9d12ae904761d76b15a556262d7eb32d1f5031fe60690224d7b0a70303cf8d39'
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ end
|
||||||
And here is one for `gateblu`. Note that it has an unversioned download (the download `url` does not contain the version number, unlike the example above). It also suppresses the checksum with `sha256 :no_check` (necessary since the checksum will change when a new distribution is made available). This combination of `version :latest` and `sha256 :no_check` is currently the preferred mechanism when a versioned download URL is not available. Also note the comment above `url`, which is needed when [the url and homepage hostnames differ](doc/CASK_LANGUAGE_REFERENCE.md#when-url-and-homepage-hostnames-differ-add-a-comment):
|
And here is one for `gateblu`. Note that it has an unversioned download (the download `url` does not contain the version number, unlike the example above). It also suppresses the checksum with `sha256 :no_check` (necessary since the checksum will change when a new distribution is made available). This combination of `version :latest` and `sha256 :no_check` is currently the preferred mechanism when a versioned download URL is not available. Also note the comment above `url`, which is needed when [the url and homepage hostnames differ](doc/CASK_LANGUAGE_REFERENCE.md#when-url-and-homepage-hostnames-differ-add-a-comment):
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'gateblu' do
|
cask 'gateblu' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ $ brew cask create my-new-cask
|
||||||
This will open `$EDITOR` with a template for your new Cask, to be stored in the file `my-new-cask.rb`. Running the `create` command above will get you a template that looks like this:
|
This will open `$EDITOR` with a template for your new Cask, to be stored in the file `my-new-cask.rb`. Running the `create` command above will get you a template that looks like this:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'my-new-cask' do
|
cask 'my-new-cask' do
|
||||||
version ''
|
version ''
|
||||||
sha256 ''
|
sha256 ''
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ All Casks and code in the homebrew-cask project should be indented using two spa
|
||||||
If relevant, you may also use string manipulations to improve the maintainability of your Cask. Here’s an example from `Lynkeos.app`:
|
If relevant, you may also use string manipulations to improve the maintainability of your Cask. Here’s an example from `Lynkeos.app`:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'lynkeos' do
|
cask 'lynkeos' do
|
||||||
version '2.10'
|
version '2.10'
|
||||||
sha256 'bd27055c51575555a1c8fe546cf057c57c0e45ea5d252510847277734dc550a4'
|
sha256 'bd27055c51575555a1c8fe546cf057c57c0e45ea5d252510847277734dc550a4'
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,7 @@ def report
|
||||||
puts "Proposed Simplified App name: #{simplified_app_name}" if $debug
|
puts "Proposed Simplified App name: #{simplified_app_name}" if $debug
|
||||||
puts "Proposed token: #{cask_token}"
|
puts "Proposed token: #{cask_token}"
|
||||||
puts "Proposed file name: #{cask_file_name}"
|
puts "Proposed file name: #{cask_file_name}"
|
||||||
puts "Cask Header Line: cask :v1 => '#{cask_token}' do"
|
puts "Cask Header Line: cask '#{cask_token}' do"
|
||||||
if warnings.length > 0
|
if warnings.length > 0
|
||||||
STDERR.puts "\n"
|
STDERR.puts "\n"
|
||||||
STDERR.puts warnings
|
STDERR.puts warnings
|
||||||
|
|
|
@ -34,7 +34,7 @@ This document acts as a complete specification, and covers aspects of the Cask D
|
||||||
Each Cask is a Ruby block, beginning with a special header line. The Cask definition itself is always enclosed in a `do … end` block. Example:
|
Each Cask is a Ruby block, beginning with a special header line. The Cask definition itself is always enclosed in a `do … end` block. Example:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'alfred' do
|
cask 'alfred' do
|
||||||
version '2.7.1_387'
|
version '2.7.1_387'
|
||||||
sha256 'a3738d0513d736918a6d71535ef3d85dd184af267c05698e49ac4c6b48f38e17'
|
sha256 'a3738d0513d736918a6d71535ef3d85dd184af267c05698e49ac4c6b48f38e17'
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ Example: [injection.rb](../Casks/injection.rb)
|
||||||
In the exceptional case that the Cask DSL is insufficient, it is possible to define arbitrary Ruby variables and methods inside the Cask by creating a `Utils` namespace. Example:
|
In the exceptional case that the Cask DSL is insufficient, it is possible to define arbitrary Ruby variables and methods inside the Cask by creating a `Utils` namespace. Example:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'myapp' do
|
cask 'myapp' do
|
||||||
module Utils
|
module Utils
|
||||||
def self.arbitrary_method
|
def self.arbitrary_method
|
||||||
...
|
...
|
||||||
|
|
|
@ -28,7 +28,7 @@ class MyApp < Cask
|
||||||
to
|
to
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask :v1 => 'my-app' do
|
cask 'my-app' do
|
||||||
```
|
```
|
||||||
|
|
||||||
Legacy rules for mapping Cask filenames to header class names are no longer needed. The token `'my-app'` in the header corresponds directly to the filename `my-app.rb`.
|
Legacy rules for mapping Cask filenames to header class names are no longer needed. The token `'my-app'` in the header corresponds directly to the filename `my-app.rb`.
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Hbc::CLI::Create < Hbc::CLI::Base
|
||||||
|
|
||||||
def self.template(cask_token)
|
def self.template(cask_token)
|
||||||
<<-EOS.undent
|
<<-EOS.undent
|
||||||
cask :v1 => '#{cask_token}' do
|
cask '#{cask_token}' do
|
||||||
version ''
|
version ''
|
||||||
sha256 ''
|
sha256 ''
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Hbc::Source::PathBase
|
||||||
|
|
||||||
# transitional hack: convert first lines of the new form
|
# transitional hack: convert first lines of the new form
|
||||||
#
|
#
|
||||||
# cask :v1 => 'google-chrome' do
|
# cask 'google-chrome' do
|
||||||
#
|
#
|
||||||
# to the old form
|
# to the old form
|
||||||
#
|
#
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe Hbc::CLI::Create do
|
||||||
Hbc::CLI::Create.run('new-cask')
|
Hbc::CLI::Create.run('new-cask')
|
||||||
template = File.read(Hbc.path('new-cask'))
|
template = File.read(Hbc.path('new-cask'))
|
||||||
template.must_equal <<-TEMPLATE.undent
|
template.must_equal <<-TEMPLATE.undent
|
||||||
cask :v1 => 'new-cask' do
|
cask 'new-cask' do
|
||||||
version ''
|
version ''
|
||||||
sha256 ''
|
sha256 ''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue