summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Koronen <koronen@kth.se>2015-08-08 16:41:29 +0200
committerVictor Koronen <koronen@kth.se>2015-08-14 12:29:43 +0200
commit8ec3bb77b0bb0f74428516253a8b915fb60dcedd (patch)
tree037d931a3ce5c390e374d887abb00361c8385249
parenta490f6a1892e6033ed0f1a12a0c8c3e188518e8d (diff)
downloadbundler-8ec3bb77b0bb0f74428516253a8b915fb60dcedd.tar.gz
Fix Style/NegatedIf
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--lib/bundler/cli/show.rb2
-rw-r--r--lib/bundler/rubygems_integration.rb2
-rw-r--r--lib/bundler/source/rubygems.rb6
4 files changed, 5 insertions, 10 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 26356f9798..57f85a912e 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -257,11 +257,6 @@ Style/MultilineOperationIndentation:
Style/MultilineTernaryOperator:
Enabled: false
-# Offense count: 5
-# Cop supports --auto-correct.
-Style/NegatedIf:
- Enabled: false
-
# Offense count: 10
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
Style/Next:
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
index 44b5894a61..50cf0a97d5 100644
--- a/lib/bundler/cli/show.rb
+++ b/lib/bundler/cli/show.rb
@@ -23,7 +23,7 @@ module Bundler
spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
return unless spec
path = spec.full_gem_path
- if !File.directory?(path)
+ unless File.directory?(path)
Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at:"
end
end
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 131eda195f..74fb175a69 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -625,7 +625,7 @@ module Bundler
require "rubygems/ext"
Gem::Ext::Builder.class_eval do
- if !const_defined?(:CHDIR_MONITOR)
+ unless const_defined?(:CHDIR_MONITOR)
const_set(:CHDIR_MONITOR, EXT_LOCK)
end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index a51813b4f9..cdbff881ca 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -345,7 +345,7 @@ module Bundler
api_fetchers.each do |f|
Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
idx.use f.specs(dependency_names, self)
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
end
# Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
@@ -358,7 +358,7 @@ module Bundler
api_fetchers.each do |f|
Bundler.ui.info "Fetching version metadata from #{f.uri}", Bundler.ui.debug?
idx.use f.specs(idx.dependency_names, self), true
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
end
break if idxcount == idx.size
end
@@ -373,7 +373,7 @@ module Bundler
api_fetchers.each do |f|
Bundler.ui.info "Fetching dependency metadata from #{f.uri}", Bundler.ui.debug?
idx.use f.specs(unmet, self)
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
end if unmet.any?
else
allow_api = false