Cleanup several files

- Harmonize whitespace: blank lines before headings, trailing whitespace
- Update syntax of URLs with range highlights
This commit is contained in:
Waldir Pimenta 2020-08-09 14:08:23 +01:00 committed by Markus Reiter
parent 89d7d2a1b3
commit 837915d9ac
4 changed files with 10 additions and 17 deletions

View File

@ -54,7 +54,6 @@ The available symbols for macOS versions are: `:yosemite`, `:el_capitan`, `:sier
Note that in the official Homebrew Cask repositories only the symbolic names are allowed. The numeric comparison may only be used for third-party taps.
### Always Fall Through to the Newest Case
Conditionals should be constructed so that the default is the newest OS version. When using an `if` statement, test for older versions, and then let the `else` statement hold the latest and greatest. This makes it more likely that the Cask will work without alteration when a new OS is released. Example (from [coconutbattery.rb](https://github.com/Homebrew/homebrew-cask/blob/2c801af44be29fff7f3cb2996455fce5dd95d1cc/Casks/coconutbattery.rb)):
@ -73,7 +72,6 @@ end
If a cask is available in multiple languages, you can use the `language` stanza to switch between languages or regions based on the system locale.
## Arbitrary Ruby Methods
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:
@ -113,7 +111,6 @@ enclosed in single quotes.
There are currently some arbitrary limitations on Cask tokens which are in the process of being removed. The Travis bot will catch any errors during the transition.
## Stanza order
Having a common order for stanzas makes Casks easier to update and parse. Below is the complete stanza sequence (no Cask will have all stanzas). The empty lines shown here are also important, as they help to visually delineate information.

View File

@ -36,7 +36,7 @@ will output an XML which you can use to extract the `choices:` values, as well a
See [this pull request for wireshark-chmodbpf](https://github.com/Homebrew/homebrew-cask/pull/26997) and [this one for wine-staging](https://github.com/Homebrew/homebrew-cask/pull/27937) for some examples of the procedure.
Example ([wireshark-chmodbpf.rb](https://github.com/Homebrew/homebrew-cask/blob/f95b8a8306b91fe9da7908b842f4a5fa80f7afe0/Casks/wireshark-chmodbpf.rb#L9#L26)):
Example ([wireshark-chmodbpf.rb](https://github.com/Homebrew/homebrew-cask/blob/f95b8a8306b91fe9da7908b842f4a5fa80f7afe0/Casks/wireshark-chmodbpf.rb#L9-L26)):
```ruby
pkg "Wireshark #{version} Intel 64.pkg",
choices: [
@ -58,7 +58,7 @@ pkg "Wireshark #{version} Intel 64.pkg",
]
```
Example ([wine-staging.rb](https://github.com/Homebrew/homebrew-cask/blob/51b65f6a5a25a7f79af4d372e1a0bf1dc3849251/Casks/wine-staging.rb#L11#L18)):
Example ([wine-staging.rb](https://github.com/Homebrew/homebrew-cask/blob/51b65f6a5a25a7f79af4d372e1a0bf1dc3849251/Casks/wine-staging.rb#L11-L18)):
```ruby
pkg "winehq-staging-#{version}.pkg",
choices: [

View File

@ -17,7 +17,7 @@ When a plain URL string is insufficient to fetch a file, additional information
| `user_agent:` | a string holding the user agent to set for the download request. Can also be set to the symbol `:fake`, which will use a generic Browser-like user agent string. We prefer `:fake` when the server does not require a specific user agent.
| `data:` | a hash of parameters to be set in the POST request
Example of using `cookies:`: [java.rb](https://github.com/Homebrew/homebrew-cask/blob/472930df191d66747a57d5c96c0d00511d56e21b/Casks/java.rb#L5#L8)
Example of using `cookies:`: [java.rb](https://github.com/Homebrew/homebrew-cask/blob/472930df191d66747a57d5c96c0d00511d56e21b/Casks/java.rb#L5-L8)
Example of using `referer:`: [rrootage.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/rrootage.rb#L5)

View File

@ -6,7 +6,6 @@
[open pull requests]: https://github.com/Homebrew/homebrew-cask/pulls
[already refused]: https://github.com/Homebrew/homebrew-cask/search?q=is%3Aclosed&type=Issues
## Adding a Cask
Making a new Cask is easy. Follow the directions in [Getting Set Up To Contribute](../../CONTRIBUTING.md#getting-set-up-to-contribute) to begin.
@ -155,7 +154,6 @@ Example:
app 'TexmakerMacosxLion/texmaker.app'
```
## Testing Your New Cask
Give it a shot with:
@ -268,19 +266,19 @@ $ git checkout -b my-new-cask-branch
Switched to a new branch 'my-new-cask-branch'
```
Stage your Cask with:
Stage your Cask with:
```bash
$ git add Casks/my-new-cask.rb
```
```
You can view the changes that are to be committed with:
You can view the changes that are to be committed with:
```bash
$ git diff --cached
```
Commit your changes with:
Commit your changes with:
```bash
$ git commit -v
@ -329,21 +327,19 @@ If you are using [GitHub two-factor authentication](https://help.github.com/arti
The `git push` command prints a suggestion to create a pull request:
```
remote: Create a pull request for 'new-cask-cask' on GitHub by visiting:
remote: Create a pull request for 'new-cask-cask' on GitHub by visiting:
remote: https://github.com/{{my-github-username}}/homebrew-cask/pull/new/my-new-cask-branch
```
#### b) use suggestion at Github website
Now go to the [`homebrew-cask` GitHub repository](https://github.com/Homebrew/homebrew-cask). GitHub will often show your `my-new-cask-branch` branch with a handy button to `Compare & pull request`.
Now go to the [`homebrew-cask` GitHub repository](https://github.com/Homebrew/homebrew-cask). GitHub will often show your `my-new-cask-branch` branch with a handy button to `Compare & pull request`.
#### c) manually create a pull request at Github website
Otherwise, click the `New pull request` button and choose to `compare across forks`. The base fork should be `Homebrew/homebrew-cask @ master`, and the head fork should be `my-github-username/homebrew-cask @ my-new-cask-branch`. You can also add any further comments to your pull request at this stage.
#### Congratulations!
#### Congratulations!
You are done now, and your Cask should be pulled in or otherwise noticed in a while. If a maintainer suggests some changes, just make them on the `my-new-cask-branch` branch locally and [push](#pushing).