Fix RuboCop Style/ group offenses in docs example code

This commit is contained in:
Issy Long 2024-01-23 21:49:08 +00:00
parent af90f0858a
commit 9b6903f50b
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 5 additions and 5 deletions

View File

@ -1076,7 +1076,7 @@ we can use:
```ruby ```ruby
version "1.2.3" version "1.2.3"
url "https://example.com/file-version-#{version.delete('.')}.dmg" url "https://example.com/file-version-#{version.delete(".")}.dmg"
``` ```
We can also leverage the power of regular expressions. So instead of: We can also leverage the power of regular expressions. So instead of:
@ -1090,7 +1090,7 @@ we can use:
```ruby ```ruby
version "1.2.3build4" version "1.2.3build4"
url "https://example.com/#{version.sub(%r{build\d+}, '')}/file-version-#{version}.dmg" url "https://example.com/#{version.sub(/build\d+/, "")}/file-version-#{version}.dmg"
``` ```
#### `version` methods #### `version` methods

View File

@ -271,7 +271,7 @@ And install any bins, and munge their shebang lines, with:
```ruby ```ruby
bin.install libexec/"bin/<bin>" bin.install libexec/"bin/<bin>"
bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"]) bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV.fetch("GEM_HOME", nil))
``` ```
### Python dependencies ### Python dependencies
@ -730,7 +730,7 @@ class MyDownloadStrategy < SomeHomebrewDownloadStrategy
end end
class Foo < Formula class Foo < Formula
url "something", :using => MyDownloadStrategy url "something", using: MyDownloadStrategy
end end
``` ```
@ -874,7 +874,7 @@ bin.write_jar_script libexec/jar_file, "jarfile", java_version: "11"
```ruby ```ruby
(bin/"package").write_env_script libexec/"package", PACKAGE_ROOT: libexec (bin/"package").write_env_script libexec/"package", PACKAGE_ROOT: libexec
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"]) bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV.fetch("PERL5LIB", nil))
``` ```
### Rewriting a script shebang ### Rewriting a script shebang