aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-20 15:11:33 +0200
committerMarkus Reiter2016-09-23 15:30:05 +0200
commit59212445da7048233ef32705433e548783fcf84b (patch)
treed1ff519490652760f5c37aa55032d82482ebbda1 /Library/Homebrew/cask/lib/hbc/cli
parentb957a1b7e6c1305617cff429f16f73f0c8ec604c (diff)
downloadbrew-59212445da7048233ef32705433e548783fcf84b.tar.bz2
Run `rubocop —auto-correct`.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/audit.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/cleanup.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/doctor.rb10
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/install.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb8
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/list.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/uninstall.rb4
9 files changed, 17 insertions, 17 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/audit.rb b/Library/Homebrew/cask/lib/hbc/cli/audit.rb
index 289547b44..14f3d8254 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/audit.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/audit.rb
@@ -6,7 +6,7 @@ class Hbc::CLI::Audit < Hbc::CLI::Base
def self.run(*args)
failed_casks = new(args, Hbc::Auditor).run
return if failed_casks.empty?
- raise Hbc::CaskError, "audit failed for casks: #{failed_casks.join(' ')}"
+ raise Hbc::CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
end
def initialize(args, auditor)
diff --git a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb
index 4115d26fc..39a90e702 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb
@@ -65,7 +65,7 @@ class Hbc::CLI::Cleanup < Hbc::CLI::Base
def remove_cache_files(*tokens)
message = "Removing cached downloads"
- message.concat " for #{tokens.join(', ')}" unless tokens.empty?
+ message.concat " for #{tokens.join(", ")}" unless tokens.empty?
message.concat " older than #{OUTDATED_DAYS} days old" if outdated_only
ohai message
diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
index 2632bcaef..7cfccd8b9 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
@@ -54,7 +54,7 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
if homebrew_origin !~ %r{\S}
homebrew_origin = "#{none_string} #{error_string}"
elsif homebrew_origin !~ %r{(mxcl|Homebrew)/(home)?brew(\.git)?\Z}
- homebrew_origin.concat " #{error_string 'warning: nonstandard origin'}"
+ homebrew_origin.concat " #{error_string "warning: nonstandard origin"}"
end
rescue StandardError
homebrew_origin = error_string "Not Found - Error running git"
@@ -106,7 +106,7 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
end
def self.privileged_uid
- Process.euid == 0 ? "Yes #{error_string 'warning: not recommended'}" : "No"
+ Process.euid.zero? ? "Yes #{error_string "warning: not recommended"}" : "No"
rescue StandardError
notfound_string
end
@@ -143,7 +143,7 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
if dir.nil? || dir.to_s.empty?
none_string
elsif dir.to_s.match(legacy_tap_pattern)
- dir.to_s.concat(" #{error_string 'Warning: legacy tap path'}")
+ dir.to_s.concat(" #{error_string "Warning: legacy tap path"}")
else
dir.to_s
end
@@ -175,9 +175,9 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
def self.render_staging_location(path)
path = Pathname.new(path)
if !path.exist?
- "#{path} #{error_string 'error: path does not exist'}}"
+ "#{path} #{error_string "error: path does not exist"}}"
elsif !path.writable?
- "#{path} #{error_string 'error: not writable by current user'}"
+ "#{path} #{error_string "error: not writable by current user"}"
else
path
end
diff --git a/Library/Homebrew/cask/lib/hbc/cli/install.rb b/Library/Homebrew/cask/lib/hbc/cli/install.rb
index 43eab9f3d..16e3b8121 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/install.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/install.rb
@@ -36,7 +36,7 @@ class Hbc::CLI::Install < Hbc::CLI::Base
count += 1
end
end
- count == 0 ? nil : count == cask_tokens.length
+ count.zero? ? nil : count == cask_tokens.length
end
def self.warn_unavailable_with_suggestion(cask_token, e)
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb
index f05dbe803..2cee09eef 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb
@@ -62,7 +62,7 @@ class Hbc::CLI::InternalAuditModifiedCasks < Hbc::CLI::InternalUseBase
end
def git_root
- @git_root ||= git(*%w[rev-parse --show-toplevel])
+ @git_root ||= git("rev-parse", "--show-toplevel")
end
def modified_cask_files
@@ -83,8 +83,8 @@ class Hbc::CLI::InternalAuditModifiedCasks < Hbc::CLI::InternalUseBase
@modified_casks = modified_cask_files.map { |f| Hbc.load(f) }
if @modified_casks.any?
num_modified = @modified_casks.size
- ohai "#{num_modified} modified #{pluralize('cask', num_modified)}: " \
- "#{@modified_casks.join(' ')}"
+ ohai "#{num_modified} modified #{pluralize("cask", num_modified)}: " \
+ "#{@modified_casks.join(" ")}"
end
@modified_casks
end
@@ -122,7 +122,7 @@ class Hbc::CLI::InternalAuditModifiedCasks < Hbc::CLI::InternalUseBase
num_failed = failed_casks.size
cask_pluralized = pluralize("cask", num_failed)
odie "audit failed for #{num_failed} #{cask_pluralized}: " \
- "#{failed_casks.join(' ')}"
+ "#{failed_casks.join(" ")}"
end
def pluralize(str, num)
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb
index d1cfe8d63..1bccf610d 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb
@@ -21,7 +21,7 @@ class Hbc::CLI::InternalDump < Hbc::CLI::InternalUseBase
opoo "#{cask_token} was not found or would not load: #{e}"
end
end
- count == 0 ? nil : count == cask_tokens.length
+ count.zero? ? nil : count == cask_tokens.length
end
def self.help
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
index 651a9ae37..0fb99cc72 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
@@ -118,7 +118,7 @@ class Hbc::CLI::InternalStanza < Hbc::CLI::InternalUseBase
count += 1
end
- count == 0 ? nil : count == cask_tokens.length
+ count.zero? ? nil : count == cask_tokens.length
end
def self.help
diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb
index 88907a797..8b9c67105 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/list.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb
@@ -48,7 +48,7 @@ class Hbc::CLI::List < Hbc::CLI::Base
end
end
- count == 0 ? nil : count == cask_tokens.length
+ count.zero? ? nil : count == cask_tokens.length
end
def self.list_artifacts(cask)
diff --git a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb
index ae15414b7..2ce9b7d4d 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb
@@ -28,8 +28,8 @@ class Hbc::CLI::Uninstall < Hbc::CLI::Base
single = versions.count == 1
puts <<-EOS.undent
- #{cask_token} #{versions.join(', ')} #{single ? 'is' : 'are'} still installed.
- Remove #{single ? 'it' : 'them all'} with `brew cask uninstall --force #{cask_token}`.
+ #{cask_token} #{versions.join(", ")} #{single ? "is" : "are"} still installed.
+ Remove #{single ? "it" : "them all"} with `brew cask uninstall --force #{cask_token}`.
EOS
end
end