summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Koronen <koronen@kth.se>2015-08-08 16:45:29 +0200
committerVictor Koronen <koronen@kth.se>2015-08-14 12:29:44 +0200
commit83acfe3b45e48b7ba7c092ba5955157f2f47a847 (patch)
treedbc8182630e37c5439a8d69a627f77a79e429a71
parent8ec3bb77b0bb0f74428516253a8b915fb60dcedd (diff)
downloadbundler-83acfe3b45e48b7ba7c092ba5955157f2f47a847.tar.gz
Fix Style/MultilineTernaryOperator
-rw-r--r--.rubocop_todo.yml4
-rw-r--r--lib/bundler.rb6
-rw-r--r--lib/bundler/rubygems_ext.rb18
3 files changed, 16 insertions, 12 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 57f85a912e..b559ba9f2c 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -253,10 +253,6 @@ Style/MultilineIfThen:
Style/MultilineOperationIndentation:
Enabled: false
-# Offense count: 4
-Style/MultilineTernaryOperator:
- Enabled: false
-
# Offense count: 10
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
Style/Next:
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 143d49e9cf..c6972ddfd8 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -222,9 +222,11 @@ module Bundler
end
def app_config_path
- ENV["BUNDLE_APP_CONFIG"] ?
- Pathname.new(ENV["BUNDLE_APP_CONFIG"]).expand_path(root) :
+ if ENV["BUNDLE_APP_CONFIG"]
+ Pathname.new(ENV["BUNDLE_APP_CONFIG"]).expand_path(root)
+ else
root.join(".bundle")
+ end
end
def app_cache(custom_path = nil)
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index eddd1fa191..9e4ce5ac17 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -22,15 +22,19 @@ module Gem
alias_method :rg_loaded_from, :loaded_from
def full_gem_path
- source.respond_to?(:path) ?
- Pathname.new(loaded_from).dirname.expand_path(Bundler.root).to_s.untaint :
+ if source.respond_to?(:path)
+ Pathname.new(loaded_from).dirname.expand_path(Bundler.root).to_s.untaint
+ else
rg_full_gem_path
+ end
end
def loaded_from
- relative_loaded_from ?
- source.path.join(relative_loaded_from).to_s :
+ if relative_loaded_from
+ source.path.join(relative_loaded_from).to_s
+ else
rg_loaded_from
+ end
end
def load_paths
@@ -48,9 +52,11 @@ module Gem
if method_defined?(:extension_dir)
alias_method :rg_extension_dir, :extension_dir
def extension_dir
- @extension_dir ||= source.respond_to?(:extension_dir_name) ?
- File.expand_path(File.join(extensions_dir, source.extension_dir_name)) :
+ @extension_dir ||= if source.respond_to?(:extension_dir_name)
+ File.expand_path(File.join(extensions_dir, source.extension_dir_name))
+ else
rg_extension_dir
+ end
end
end