From 1806aaf9a35cd3ec405ca49f3738417c0c0e9d3b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 20 Jul 2016 07:05:31 +0200 Subject: [PATCH] Change hash rockets to colons. (#22951) --- Casks/ableton-live.rb | 2 +- Casks/blue-jeans-browser-plugin.rb | 2 +- Casks/displaylink.rb | 8 ++--- Casks/netbeans.rb | 2 +- developer/bin/list_ids_in_app | 2 +- developer/bin/list_ids_in_pkg | 2 +- developer/bin/list_installed_launchjob_ids | 2 +- developer/bin/list_loaded_kext_ids | 2 +- developer/bin/list_loaded_launchjob_ids | 2 +- developer/bin/list_login_items_for_app | 2 +- developer/bin/list_recent_pkg_ids | 2 +- developer/bin/list_running_app_ids | 2 +- doc/cask_language_reference/stanzas/gpg.md | 2 +- lib/hbc/container/naked.rb | 2 +- lib/hbc/dsl/depends_on.rb | 10 +++--- test/cask/depends_on_test.rb | 34 ++++++++++---------- test/cask/dsl_test.rb | 36 +++++++++++----------- 17 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Casks/ableton-live.rb b/Casks/ableton-live.rb index b43bc89542..631a20a96a 100644 --- a/Casks/ableton-live.rb +++ b/Casks/ableton-live.rb @@ -17,5 +17,5 @@ cask 'ableton-live' do zap delete: '~/Library/*/*[Aa]bleton*', rmdir: '~/Music/Ableton/Factory Packs' - #:trash => '~/Music/Ableton/User Library' + # trash: '~/Music/Ableton/User Library' end diff --git a/Casks/blue-jeans-browser-plugin.rb b/Casks/blue-jeans-browser-plugin.rb index ed77746752..663ba9b819 100644 --- a/Casks/blue-jeans-browser-plugin.rb +++ b/Casks/blue-jeans-browser-plugin.rb @@ -12,7 +12,7 @@ cask 'blue-jeans-browser-plugin' do internet_plugin "rbjninstallplugin_#{version}.plugin" internet_plugin "rbjnplugin_#{version}.plugin" - # container :nested => 'Scripts' doesn't recognize a gzipped CPIO + # container nested: 'Scripts' doesn't recognize a gzipped CPIO preflight do system '/usr/bin/tar', '-xf', "#{staged_path}/Scripts", '-C', staged_path system '/bin/rm', '-f', '--', "#{staged_path}/Scripts" diff --git a/Casks/displaylink.rb b/Casks/displaylink.rb index a5aec8734d..c973672459 100644 --- a/Casks/displaylink.rb +++ b/Casks/displaylink.rb @@ -25,10 +25,10 @@ cask 'displaylink' do 'com.displaylink.displaylinkdriverunsigned', ], # 'kextunload -b com.displaylink.driver.DisplayLinkDriver' causes kernel panic - # :kext => [ - # 'com.displaylink.driver.DisplayLinkDriver', - # 'com.displaylink.dlusbncm' - # ], + # kext: [ + # 'com.displaylink.driver.DisplayLinkDriver', + # 'com.displaylink.dlusbncm' + # ], launchctl: [ 'com.displaylink.useragent-prelogin', 'com.displaylink.useragent', diff --git a/Casks/netbeans.rb b/Casks/netbeans.rb index 712a8d0dc4..cb4c795994 100644 --- a/Casks/netbeans.rb +++ b/Casks/netbeans.rb @@ -22,7 +22,7 @@ cask 'netbeans' do # receipts database that would be a bug upstream with NetBeans not prefixing # its GlassFish package with "org.netbeans." # - # If this ever becomes an issue, :pkgutil => 'glassfish-.*' could be moved + # If this ever becomes an issue, pkgutil: 'glassfish-.*' could be moved # to a separate "zap" stanza. # # The NetBeans installer does some postflight unpacking of paths installed by diff --git a/developer/bin/list_ids_in_app b/developer/bin/list_ids_in_app index 62b2e654f1..89bb253a5f 100755 --- a/developer/bin/list_ids_in_app +++ b/developer/bin/list_ids_in_app @@ -138,7 +138,7 @@ Given a Application (app) bundle directory on disk, extract the associated app Bundle ID, which may be useful in a Cask uninstall stanza, eg - uninstall :quit => 'app.id.goes.here' + uninstall quit: 'app.id.goes.here' The app need not be running for this script to work. diff --git a/developer/bin/list_ids_in_pkg b/developer/bin/list_ids_in_pkg index ddb86606c8..3b0dec4a68 100755 --- a/developer/bin/list_ids_in_pkg +++ b/developer/bin/list_ids_in_pkg @@ -86,7 +86,7 @@ if [[ $1 =~ ^-+h(elp)?$ || -z "$1" ]]; then Given a package file, extract a list of candidate Package IDs which may be useful in a Cask uninstall stanza, eg - uninstall :pkgutil => 'package.id.goes.here' + uninstall pkgutil: 'package.id.goes.here' The given package file need not be installed. diff --git a/developer/bin/list_installed_launchjob_ids b/developer/bin/list_installed_launchjob_ids index 886ccfa0e7..82672c2c9e 100755 --- a/developer/bin/list_installed_launchjob_ids +++ b/developer/bin/list_installed_launchjob_ids @@ -68,7 +68,7 @@ if [[ $1 =~ ^-+h(elp)?$ ]]; then List all installed launchjob IDs, which may be useful in a Cask uninstall stanza, eg - uninstall :launchctl => 'job.id.goes.here' + uninstall launchctl: 'job.id.goes.here' Launchctl jobs attributed to Apple will be ommitted. diff --git a/developer/bin/list_loaded_kext_ids b/developer/bin/list_loaded_kext_ids index caca550368..19b47cb078 100755 --- a/developer/bin/list_loaded_kext_ids +++ b/developer/bin/list_loaded_kext_ids @@ -29,7 +29,7 @@ if [[ $1 =~ ^-+h(elp)?$ ]]; then Print Bundle IDs for currently loaded Kernel Extensions (kexts) which may be useful in a Cask uninstall stanza, eg - uninstall :kext => 'kext.bundle.id.goes.here' + uninstall kext: 'kext.bundle.id.goes.here' Kexts attributed to Apple are excluded from the output. diff --git a/developer/bin/list_loaded_launchjob_ids b/developer/bin/list_loaded_launchjob_ids index f0d2fce956..4b1330b705 100755 --- a/developer/bin/list_loaded_launchjob_ids +++ b/developer/bin/list_loaded_launchjob_ids @@ -63,7 +63,7 @@ if [[ $1 =~ ^-+h(elp)?$ ]]; then List IDs for currently-loaded launchctl jobs, which may be useful in a Cask uninstall stanza, eg - uninstall :launchctl => 'job.id.goes.here' + uninstall launchctl: 'job.id.goes.here' If this command is not run as the superuser, you will be prompted for a password to run a subcommand using 'sudo'. The password is diff --git a/developer/bin/list_login_items_for_app b/developer/bin/list_login_items_for_app index ae1dc41536..f775347efc 100755 --- a/developer/bin/list_login_items_for_app +++ b/developer/bin/list_login_items_for_app @@ -21,7 +21,7 @@ Given an Application (app) bundle directory on disk, find all login items associated with that app, which you can use in a Cask uninstall stanza, eg - uninstall :login_item => 'login item name' + uninstall login_item: 'login item name' Note that you will likely need to have opened the app at least once for any login items to be present. diff --git a/developer/bin/list_recent_pkg_ids b/developer/bin/list_recent_pkg_ids index 1220ea99e4..0c203ec26c 100755 --- a/developer/bin/list_recent_pkg_ids +++ b/developer/bin/list_recent_pkg_ids @@ -30,7 +30,7 @@ if [[ $1 =~ ^-+h(elp)?$ ]]; then Print pkg receipt IDs for the 10 most-recently-installed packages, which may be useful in a Cask uninstall stanza, eg - uninstall :pkgutil => 'pkg.receipt.id.goes.here' + uninstall pkgutil: 'pkg.receipt.id.goes.here' Package IDs attributed to Apple are excluded from the output. diff --git a/developer/bin/list_running_app_ids b/developer/bin/list_running_app_ids index 7261f55bfb..bd4133407b 100755 --- a/developer/bin/list_running_app_ids +++ b/developer/bin/list_running_app_ids @@ -34,7 +34,7 @@ list_running_app_ids [ -t ] Print a list of currently running Applications and associated Bundle IDs, which may be useful in a Cask uninstall stanza, eg - uninstall :quit => 'bundle.id.goes.here' + uninstall quit: 'bundle.id.goes.here' Applications attributed to Apple are excluded from the output. diff --git a/doc/cask_language_reference/stanzas/gpg.md b/doc/cask_language_reference/stanzas/gpg.md index fb2c4889da..cb0e3ef846 100644 --- a/doc/cask_language_reference/stanzas/gpg.md +++ b/doc/cask_language_reference/stanzas/gpg.md @@ -5,7 +5,7 @@ The `gpg` stanza contains signature information for GPG-signed distributions. The form is: ```ruby -gpg , => +gpg , : ``` where `` is one of `key_id:` or `key_url:`, and `` points to the detached signature of the distribution. Commonly, the signature follows the `url` value. Example: [libreoffice.rb](https://github.com/caskroom/homebrew-cask/blob/42abacc85798d8c0b8d3f47c70b62ee65ce5ceaa/Casks/libreoffice.rb#L16#L17). diff --git a/lib/hbc/container/naked.rb b/lib/hbc/container/naked.rb index e996b99311..4214345b8f 100644 --- a/lib/hbc/container/naked.rb +++ b/lib/hbc/container/naked.rb @@ -1,6 +1,6 @@ class Hbc::Container::Naked < Hbc::Container::Base # Either inherit from this class and override with self.me?(criteria), - # or use this class directly as "container :type => :naked", + # or use this class directly as "container type: :naked", # in which case self.me? is not called. def self.me?(*) false diff --git a/lib/hbc/dsl/depends_on.rb b/lib/hbc/dsl/depends_on.rb index 47cf89f100..e2035bb2c3 100644 --- a/lib/hbc/dsl/depends_on.rb +++ b/lib/hbc/dsl/depends_on.rb @@ -69,7 +69,7 @@ class Hbc::DSL::DependsOn raise end rescue StandardError - raise "invalid 'depends_on :macos' value: #{arg.inspect}" + raise "invalid 'depends_on macos' value: #{arg.inspect}" end end @@ -86,12 +86,12 @@ class Hbc::DSL::DependsOn def macos=(*arg) @macos ||= [] macos = if arg.count == 1 && arg.first =~ %r{^\s*(<|>|[=<>]=)\s*(\S+)\s*$} - raise "'depends_on :macos' comparison expressions cannot be combined" unless @macos.empty? + raise "'depends_on macos' comparison expressions cannot be combined" unless @macos.empty? operator = Regexp.last_match[1].to_sym release = self.class.coerce_os_release(Regexp.last_match[2]) [[operator, release]] else - raise "'depends_on :macos' comparison expressions cannot be combined" if @macos.first.is_a?(Symbol) + raise "'depends_on macos' comparison expressions cannot be combined" if @macos.first.is_a?(Symbol) Array(*arg).map { |elt| self.class.coerce_os_release(elt) }.sort @@ -106,12 +106,12 @@ class Hbc::DSL::DependsOn ARCH_SYNONYMS.key?(elt) ? ARCH_SYNONYMS[elt] : elt } invalid_arches = arches - VALID_ARCHES - raise "invalid 'depends_on :arch' values: #{invalid_arches.inspect}" unless invalid_arches.empty? + raise "invalid 'depends_on arch' values: #{invalid_arches.inspect}" unless invalid_arches.empty? @arch.concat(arches) end def x11=(arg) - raise "invalid depends_on :x11 value: #{arg.inspect}" unless [true, false].include?(arg) + raise "invalid 'depends_on x11' value: #{arg.inspect}" unless [true, false].include?(arg) @x11 = arg end diff --git a/test/cask/depends_on_test.rb b/test/cask/depends_on_test.rb index a00a766265..31e51b5e5e 100644 --- a/test/cask/depends_on_test.rb +++ b/test/cask/depends_on_test.rb @@ -3,16 +3,16 @@ require "test_helper" # TODO: this test should be named after the corresponding class, once # that class is abstracted from installer.rb describe "Satisfy Dependencies and Requirements" do - # TODO: test that depends_on :formula invokes Homebrew + # TODO: test that depends_on formula invokes Homebrew # - # describe "depends_on :formula" do + # describe "depends_on formula" do # it "" do # end # end # - describe "depends_on :cask" do - it "raises an exception when depends_on :cask is cyclic" do + describe "depends_on cask" do + it "raises an exception when depends_on cask is cyclic" do dep_cask = Hbc.load("with-depends-on-cask-cyclic") lambda { shutup do @@ -33,36 +33,36 @@ describe "Satisfy Dependencies and Requirements" do end end - describe "depends_on :macos" do - it "understands depends_on :macos => " do + describe "depends_on macos" do + it "understands depends_on macos: " do macos_cask = Hbc.load("with-depends-on-macos-array") shutup do Hbc::Installer.new(macos_cask).install end end - it "understands depends_on :macos => " do + it "understands depends_on macos: " do macos_cask = Hbc.load("with-depends-on-macos-comparison") shutup do Hbc::Installer.new(macos_cask).install end end - it "understands depends_on :macos => " do + it "understands depends_on macos: " do macos_cask = Hbc.load("with-depends-on-macos-string") shutup do Hbc::Installer.new(macos_cask).install end end - it "understands depends_on :macos => " do + it "understands depends_on macos: " do macos_cask = Hbc.load("with-depends-on-macos-symbol") shutup do Hbc::Installer.new(macos_cask).install end end - it "raises an exception when depends_on :macos is not satisfied" do + it "raises an exception when depends_on macos is not satisfied" do macos_cask = Hbc.load("with-depends-on-macos-failure") lambda { shutup do @@ -72,15 +72,15 @@ describe "Satisfy Dependencies and Requirements" do end end - describe "depends_on :arch" do - it "succeeds when depends_on :arch is satisfied" do + describe "depends_on arch" do + it "succeeds when depends_on arch is satisfied" do arch_cask = Hbc.load("with-depends-on-arch") shutup do Hbc::Installer.new(arch_cask).install end end - it "raises an exception when depends_on :arch is not satisfied" do + it "raises an exception when depends_on arch is not satisfied" do arch_cask = Hbc.load("with-depends-on-arch-failure") lambda { shutup do @@ -90,15 +90,15 @@ describe "Satisfy Dependencies and Requirements" do end end - describe "depends_on :x11" do - it "succeeds when depends_on :x11 is satisfied" do + describe "depends_on x11" do + it "succeeds when depends_on x11 is satisfied" do x11_cask = Hbc.load("with-depends-on-x11") shutup do Hbc::Installer.new(x11_cask).install end end - it "raises an exception when depends_on :x11 is not satisfied" do + it "raises an exception when depends_on x11 is not satisfied" do x11_cask = Hbc.load("with-depends-on-x11") Hbc.stubs(:x11_libpng).returns([Pathname.new("/usr/path/does/not/exist")]) lambda { @@ -108,7 +108,7 @@ describe "Satisfy Dependencies and Requirements" do }.must_raise(Hbc::CaskX11DependencyError) end - it "never raises when depends_on :x11 => false" do + it "never raises when depends_on x11: false" do x11_cask = Hbc.load("with-depends-on-x11-false") Hbc.stubs(:x11_executable).returns(Pathname.new("/usr/path/does/not/exist")) lambda do diff --git a/test/cask/dsl_test.rb b/test/cask/dsl_test.rb index fea97a9bf8..4cd30d2414 100644 --- a/test/cask/dsl_test.rb +++ b/test/cask/dsl_test.rb @@ -269,65 +269,65 @@ describe Hbc::DSL do end end - describe "depends_on :formula" do - it "allows depends_on :formula to be specified" do + describe "depends_on formula" do + it "allows depends_on formula to be specified" do cask = Hbc.load("with-depends-on-formula") cask.depends_on.formula.wont_be_nil end - it "allows multiple depends_on :formula to be specified" do + it "allows multiple depends_on formula to be specified" do cask = Hbc.load("with-depends-on-formula-multiple") cask.depends_on.formula.wont_be_nil end end - describe "depends_on :cask" do - it "allows depends_on :cask to be specified" do + describe "depends_on cask" do + it "allows depends_on cask to be specified" do cask = Hbc.load("with-depends-on-cask") cask.depends_on.cask.wont_be_nil end - it "allows multiple depends_on :cask to be specified" do + it "allows multiple depends_on cask to be specified" do cask = Hbc.load("with-depends-on-cask-multiple") cask.depends_on.cask.wont_be_nil end end - describe "depends_on :macos" do - it "allows depends_on :macos to be specified" do + describe "depends_on macos" do + it "allows depends_on macos to be specified" do cask = Hbc.load("with-depends-on-macos-string") cask.depends_on.macos.wont_be_nil end - it "refuses to load with an invalid depends_on :macos value" do + it "refuses to load with an invalid depends_on macos value" do lambda { Hbc.load("invalid/invalid-depends-on-macos-bad-release") }.must_raise(Hbc::CaskInvalidError) end - it "refuses to load with conflicting depends_on :macos forms" do + it "refuses to load with conflicting depends_on macos forms" do lambda { Hbc.load("invalid/invalid-depends-on-macos-conflicting-forms") }.must_raise(Hbc::CaskInvalidError) end end - describe "depends_on :arch" do - it "allows depends_on :arch to be specified" do + describe "depends_on arch" do + it "allows depends_on arch to be specified" do cask = Hbc.load("with-depends-on-arch") cask.depends_on.arch.wont_be_nil end - it "refuses to load with an invalid depends_on :arch value" do + it "refuses to load with an invalid depends_on arch value" do lambda { Hbc.load("invalid/invalid-depends-on-arch-value") }.must_raise(Hbc::CaskInvalidError) end end - describe "depends_on :x11" do - it "allows depends_on :x11 to be specified" do + describe "depends_on x11" do + it "allows depends_on x11 to be specified" do cask = Hbc.load("with-depends-on-x11") cask.depends_on.x11.wont_be_nil end - it "refuses to load with an invalid depends_on :x11 value" do + it "refuses to load with an invalid depends_on x11 value" do lambda { Hbc.load("invalid/invalid-depends-on-x11-value") }.must_raise(Hbc::CaskInvalidError) @@ -373,14 +373,14 @@ describe Hbc::DSL do end describe "installer stanza" do - it "allows installer :script to be specified" do + it "allows installer script to be specified" do cask = Hbc.load("with-installer-script") cask.artifacts[:installer].first.script[:executable].must_equal "/usr/bin/true" cask.artifacts[:installer].first.script[:args].must_equal ["--flag"] cask.artifacts[:installer].to_a[1].script[:executable].must_equal "/usr/bin/false" cask.artifacts[:installer].to_a[1].script[:args].must_equal ["--flag"] end - it "allows installer :manual to be specified" do + it "allows installer manual to be specified" do cask = Hbc.load("with-installer-manual") cask.artifacts[:installer].first.manual.must_equal "Caffeine.app" end