From 8e9eae695adff40df52e667db30dd4fc318615ef Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 14 Oct 2016 20:08:05 +0200 Subject: [PATCH] Use `()` as delimiters for `%Q` and `%q` literals. --- Library/Homebrew/cask/lib/hbc/artifact/relocated.rb | 2 +- .../Homebrew/cask/lib/hbc/artifact/uninstall_base.rb | 10 +++++----- Library/Homebrew/cask/lib/hbc/cli.rb | 2 +- Library/Homebrew/cask/lib/hbc/cli/doctor.rb | 4 ++-- Library/Homebrew/cask/lib/hbc/cli/edit.rb | 2 +- Library/Homebrew/cask/lib/hbc/exceptions.rb | 2 +- Library/Homebrew/cask/lib/hbc/installer.rb | 2 +- Library/Homebrew/cask/lib/hbc/utils/hash_validator.rb | 2 +- .../Homebrew/cask/test/cask/artifact/uninstall_test.rb | 6 +++--- Library/Homebrew/cask/test/cask/artifact/zap_test.rb | 6 +++--- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb index 335d7e2fcc..aa12dfa4a3 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/relocated.rb @@ -31,7 +31,7 @@ module Hbc print_stderr: false).stdout.sub(/\A\((.*)\)\Z/, '\1') odebug "Existing metadata is: '#{altnames}'" altnames.concat(", ") unless altnames.empty? - altnames.concat(%Q{"#{altname}"}) + altnames.concat(%Q("#{altname}")) altnames = "(#{altnames})" # Some packges are shipped as u=rx (e.g. Bitcoin Core) diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb index b871cbc459..68eb7b93c9 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb @@ -87,7 +87,7 @@ module Hbc def warn_for_unknown_directives(directives) unknown_keys = directives.keys - ORDERED_DIRECTIVES return if unknown_keys.empty? - opoo %Q{Unknown arguments to #{stanza} -- #{unknown_keys.inspect}. Running "brew update; brew cleanup; brew cask cleanup" will likely fix it.} + opoo %Q(Unknown arguments to #{stanza} -- #{unknown_keys.inspect}. Running "brew update; brew cleanup; brew cask cleanup" will likely fix it.) end # Preserve prior functionality of script which runs first. Should rarely be needed. @@ -129,7 +129,7 @@ module Hbc ohai "Quitting application ID #{id}" num_running = count_running_processes(id) next unless num_running > 0 - @command.run!("/usr/bin/osascript", args: ["-e", %Q{tell application id "#{id}" to quit}], sudo: true) + @command.run!("/usr/bin/osascript", args: ["-e", %Q(tell application id "#{id}" to quit)], sudo: true) sleep 3 end end @@ -156,13 +156,13 @@ module Hbc def count_running_processes(bundle_id) @command.run!("/usr/bin/osascript", - args: ["-e", %Q{tell application "System Events" to count processes whose bundle identifier is "#{bundle_id}"}], + args: ["-e", %Q(tell application "System Events" to count processes whose bundle identifier is "#{bundle_id}")], sudo: true).stdout.to_i end def get_unix_pids(bundle_id) pid_string = @command.run!("/usr/bin/osascript", - args: ["-e", %Q{tell application "System Events" to get the unix id of every process whose bundle identifier is "#{bundle_id}"}], + args: ["-e", %Q(tell application "System Events" to get the unix id of every process whose bundle identifier is "#{bundle_id}")], sudo: true).stdout.chomp return [] unless pid_string =~ /\A\d+(?:\s*,\s*\d+)*\Z/ # sanity check pid_string.split(/\s*,\s*/).map(&:strip).map(&:to_i) @@ -172,7 +172,7 @@ module Hbc Array(directives[:login_item]).each do |name| ohai "Removing login item #{name}" @command.run!("/usr/bin/osascript", - args: ["-e", %Q{tell application "System Events" to delete every login item whose name is "#{name}"}], + args: ["-e", %Q(tell application "System Events" to delete every login item whose name is "#{name}")], sudo: false) sleep 1 end diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index cd12ab0860..b3b799d499 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -266,7 +266,7 @@ module Hbc next unless klass.visible puts " #{klass.command_name.ljust(max_command_len)} #{_help_for(klass)}" end - puts %Q{\nSee also "man brew-cask"} + puts %Q(\nSee also "man brew-cask") end def help diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb index 873ca47fde..a41781a0cf 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb @@ -104,7 +104,7 @@ module Hbc end def self.locale_variables - ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).collect { |v| %Q{#{v}="#{ENV[v]}"} }.sort.join("\n") + ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).collect { |v| %Q(#{v}="#{ENV[v]}") }.sort.join("\n") end def self.privileged_uid @@ -154,7 +154,7 @@ module Hbc def self.render_env_var(var) if ENV.key?(var) - %Q{#{var}="#{ENV[var]}"} + %Q(#{var}="#{ENV[var]}") else none_string end diff --git a/Library/Homebrew/cask/lib/hbc/cli/edit.rb b/Library/Homebrew/cask/lib/hbc/cli/edit.rb index a6ff342341..a6cb9e2092 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/edit.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/edit.rb @@ -9,7 +9,7 @@ module Hbc cask_path = Hbc.path(cask_token) odebug "Opening editor for Cask #{cask_token}" unless cask_path.exist? - raise CaskUnavailableError, %Q{#{cask_token}, run "brew cask create #{cask_token}" to create a new Cask} + raise CaskUnavailableError, %Q(#{cask_token}, run "brew cask create #{cask_token}" to create a new Cask) end exec_editor cask_path end diff --git a/Library/Homebrew/cask/lib/hbc/exceptions.rb b/Library/Homebrew/cask/lib/hbc/exceptions.rb index 31310aea50..c323f6c4cc 100644 --- a/Library/Homebrew/cask/lib/hbc/exceptions.rb +++ b/Library/Homebrew/cask/lib/hbc/exceptions.rb @@ -23,7 +23,7 @@ module Hbc class CaskAlreadyCreatedError < AbstractCaskErrorWithToken def to_s - %Q{A Cask for #{token} already exists. Run "brew cask cat #{token}" to see it.} + %Q(A Cask for #{token} already exists. Run "brew cask cat #{token}" to see it.) end end diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index 9575aa1814..12d79132b5 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -302,7 +302,7 @@ module Hbc end def zap - ohai %Q{Implied "brew cask uninstall #{@cask}"} + ohai %Q(Implied "brew cask uninstall #{@cask}") uninstall_artifacts if Artifact::Zap.me?(@cask) ohai "Dispatching zap stanza" diff --git a/Library/Homebrew/cask/lib/hbc/utils/hash_validator.rb b/Library/Homebrew/cask/lib/hbc/utils/hash_validator.rb index b9e11720d1..6c8f95c3a4 100644 --- a/Library/Homebrew/cask/lib/hbc/utils/hash_validator.rb +++ b/Library/Homebrew/cask/lib/hbc/utils/hash_validator.rb @@ -2,6 +2,6 @@ module HashValidator def assert_valid_keys(*valid_keys) unknown_keys = keys - valid_keys return if unknown_keys.empty? - raise CaskError, %Q{Unknown keys: #{unknown_keys.inspect}. Running "#{UPDATE_CMD}" will likely fix it.} + raise CaskError, %Q(Unknown keys: #{unknown_keys.inspect}. Running "#{UPDATE_CMD}" will likely fix it.) end end diff --git a/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb b/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb index 4ab2dc3d28..08c179a534 100644 --- a/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb @@ -201,10 +201,10 @@ describe Hbc::Artifact::Uninstall do let(:bundle_id) { "my.fancy.package.app" } let(:count_processes_script) { 'tell application "System Events" to count processes ' + - %Q{whose bundle identifier is "#{bundle_id}"} + %Q(whose bundle identifier is "#{bundle_id}") } let(:quit_application_script) { - %Q{tell application id "#{bundle_id}" to quit} + %Q(tell application id "#{bundle_id}" to quit) } it "can uninstall" do @@ -227,7 +227,7 @@ describe Hbc::Artifact::Uninstall do let(:unix_pids) { [12_345, 67_890] } let(:get_unix_pids_script) { 'tell application "System Events" to get the unix id of every process ' + - %Q{whose bundle identifier is "#{bundle_id}"} + %Q(whose bundle identifier is "#{bundle_id}") } it "can uninstall" do diff --git a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb index 489299eca3..da80f7bdea 100644 --- a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb @@ -202,10 +202,10 @@ describe Hbc::Artifact::Zap do let(:bundle_id) { "my.fancy.package.app" } let(:count_processes_script) { 'tell application "System Events" to count processes ' + - %Q{whose bundle identifier is "#{bundle_id}"} + %Q(whose bundle identifier is "#{bundle_id}") } let(:quit_application_script) { - %Q{tell application id "#{bundle_id}" to quit} + %Q(tell application id "#{bundle_id}" to quit) } it "can zap" do @@ -228,7 +228,7 @@ describe Hbc::Artifact::Zap do let(:unix_pids) { [12_345, 67_890] } let(:get_unix_pids_script) { 'tell application "System Events" to get the unix id of every process ' + - %Q{whose bundle identifier is "#{bundle_id}"} + %Q(whose bundle identifier is "#{bundle_id}") } it "can zap" do