Skip to content

Commit

Permalink
Remove DSL versions in docs and scripts
Browse files Browse the repository at this point in the history
Closes #15912.
  • Loading branch information
jawshooah committed Dec 18, 2015
1 parent 3ef9d9e commit 25f7cfe
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

```ruby
cask :v1 => 'shuttle' do
cask 'shuttle' do
version '1.2.5'
sha256 '7df182f506b80011222c0cdd470be76e0376f38e331f3fafbb6af9add3578023'

Expand All @@ -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:

```ruby
cask :v1 => 'genymotion' do
cask 'genymotion' do
version '2.6.0'
sha256 '9d12ae904761d76b15a556262d7eb32d1f5031fe60690224d7b0a70303cf8d39'

Expand All @@ -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):

```ruby
cask :v1 => 'gateblu' do
cask 'gateblu' do
version :latest
sha256 :no_check

Expand Down Expand Up @@ -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:

```ruby
cask :v1 => 'my-new-cask' do
cask 'my-new-cask' do
version ''
sha256 ''

Expand Down Expand Up @@ -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`:

```ruby
cask :v1 => 'lynkeos' do
cask 'lynkeos' do
version '2.10'
sha256 'bd27055c51575555a1c8fe546cf057c57c0e45ea5d252510847277734dc550a4'

Expand Down
2 changes: 1 addition & 1 deletion developer/bin/generate_cask_token
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def report
puts "Proposed Simplified App name: #{simplified_app_name}" if $debug
puts "Proposed token: #{cask_token}"
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
STDERR.puts "\n"
STDERR.puts warnings
Expand Down
4 changes: 2 additions & 2 deletions doc/CASK_LANGUAGE_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```ruby
cask :v1 => 'alfred' do
cask 'alfred' do
version '2.7.1_387'
sha256 'a3738d0513d736918a6d71535ef3d85dd184af267c05698e49ac4c6b48f38e17'

Expand Down Expand Up @@ -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:

```ruby
cask :v1 => 'myapp' do
cask 'myapp' do
module Utils
def self.arbitrary_method
...
Expand Down
2 changes: 1 addition & 1 deletion doc/cask_language_deltas.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MyApp < Cask
to

```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`.
Expand Down
2 changes: 1 addition & 1 deletion lib/hbc/cli/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.exec_editor(*args)

def self.template(cask_token)
<<-EOS.undent
cask :v1 => '#{cask_token}' do
cask '#{cask_token}' do
version ''
sha256 ''
Expand Down
2 changes: 1 addition & 1 deletion lib/hbc/source/path_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def load

# transitional hack: convert first lines of the new form
#
# cask :v1 => 'google-chrome' do
# cask 'google-chrome' do
#
# to the old form
#
Expand Down
2 changes: 1 addition & 1 deletion test/cask/cli/create_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.editor_commands
Hbc::CLI::Create.run('new-cask')
template = File.read(Hbc.path('new-cask'))
template.must_equal <<-TEMPLATE.undent
cask :v1 => 'new-cask' do
cask 'new-cask' do
version ''
sha256 ''
Expand Down

0 comments on commit 25f7cfe

Please sign in to comment.