aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli
diff options
context:
space:
mode:
authorMike McQuaid2017-05-29 18:24:52 +0100
committerMike McQuaid2017-05-29 18:43:18 +0100
commit7a38bab333c6808022fe53aac2be9ca2e329cd53 (patch)
treebbc05eebc29bdb6d539cd0e9d197b3762b49ffce /Library/Homebrew/cask/lib/hbc/cli
parent4356016b4a1c2eaba02680b4ad7f1747d2df53bf (diff)
downloadbrew-7a38bab333c6808022fe53aac2be9ca2e329cd53.tar.bz2
Fixup all RuboCop warnings.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/doctor.rb22
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/info.rb6
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/install.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/list.rb2
6 files changed, 18 insertions, 18 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb b/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb
index 7ee3be337..7470e36db 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb
@@ -15,7 +15,7 @@ module Hbc
end
def self.abstract?
- !(name.split("::").last !~ /^Abstract[^a-z]/)
+ name.split("::").last =~ /^Abstract[^a-z]/
end
def self.visible
diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
index fe7889b73..cd6ebbc12 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
@@ -17,17 +17,17 @@ module Hbc
ohai "Contents of $LOAD_PATH", self.class.render_load_path($LOAD_PATH)
ohai "Environment Variables"
- environment_variables = [
- "RUBYLIB",
- "RUBYOPT",
- "RUBYPATH",
- "RBENV_VERSION",
- "CHRUBY_VERSION",
- "GEM_HOME",
- "GEM_PATH",
- "BUNDLE_PATH",
- "PATH",
- "SHELL",
+ environment_variables = %w[
+ RUBYLIB
+ RUBYOPT
+ RUBYPATH
+ RBENV_VERSION
+ CHRUBY_VERSION
+ GEM_HOME
+ GEM_PATH
+ BUNDLE_PATH
+ PATH
+ SHELL
]
(self.class.locale_variables + environment_variables).sort.each(&self.class.method(:render_env_var))
diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb
index dcfc8d9bb..2b0b49cd3 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/info.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb
@@ -41,7 +41,7 @@ module Hbc
puts versioned_staged_path.to_s
.concat(" (")
.concat(versioned_staged_path.exist? ? versioned_staged_path.abv : Formatter.error("does not exist"))
- .concat(")")
+ .concat(")")
end
else
puts "Not installed"
@@ -49,7 +49,7 @@ module Hbc
end
def self.name_info(cask)
- ohai cask.name.size > 1 ? "Names" : "Name"
+ ohai((cask.name.size > 1) ? "Names" : "Name")
puts cask.name.empty? ? Formatter.error("None") : cask.name
end
@@ -69,7 +69,7 @@ module Hbc
DSL::ORDINARY_ARTIFACT_TYPES.each do |type|
next if cask.artifacts[type].empty?
cask.artifacts[type].each do |artifact|
- activatable_item = type == :stage_only ? "<none>" : artifact.first
+ activatable_item = (type == :stage_only) ? "<none>" : artifact.first
puts "#{activatable_item} (#{type})"
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/cli/install.rb b/Library/Homebrew/cask/lib/hbc/cli/install.rb
index 5acd837b1..72f85fc69 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/install.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/install.rb
@@ -24,7 +24,7 @@ module Hbc
begin
cask = CaskLoader.load(cask_token)
Installer.new(cask, binaries: binaries?,
- verbose: verbose?,
+ verbose: verbose?,
force: force?,
skip_cask_deps: skip_cask_deps?,
require_sha: require_sha?).install
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb
index da0223b14..ceb202bb7 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb
@@ -43,7 +43,7 @@ module Hbc
if checkpoint.nil?
onoe "Could not retrieve `appcast` checkpoint for cask '#{cask}': #{result[:command_result].stderr}"
else
- puts cask_tokens.count > 1 ? "#{checkpoint} #{cask}": checkpoint
+ puts((cask_tokens.count > 1) ? "#{checkpoint} #{cask}": checkpoint)
count += 1
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb
index 04dccbf85..9d2ded4be 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/list.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb
@@ -12,7 +12,7 @@ module Hbc
def run
retval = args.any? ? list : list_installed
# retval is ternary: true/false/nil
- if retval.nil? && !args.any?
+ if retval.nil? && args.none?
opoo "nothing to list" # special case: avoid exit code
elsif retval.nil?
raise CaskError, "nothing to list"