summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Werbin <spam@me.gregwerbin.com>2017-09-11 15:31:33 -0400
committerGreg Werbin <spam@me.gregwerbin.com>2017-09-11 15:31:33 -0400
commitabb8f976f669b8a7a1ddb80928ebd64e00c05560 (patch)
tree6f07c6a69f7cb5adba1bbfdaacd075bafab74fd2
parentbea279736a06c852ef7b24e07de3c238fcb78518 (diff)
downloadbundler-abb8f976f669b8a7a1ddb80928ebd64e00c05560.tar.gz
Conform to code style
-rw-r--r--lib/bundler.rb24
-rw-r--r--spec/bundler/bundler_spec.rb1
2 files changed, 12 insertions, 13 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 8a7296d8e7..1157239029 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -193,19 +193,19 @@ module Bundler
raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
end
- def user_bundle_path(dir="home")
+ def user_bundle_path(dir = "home")
env_var, fallback = case dir
- when "home"
- ["BUNDLE_USER_HOME", Pathname.new(user_home).join(".bundle")]
- when "cache"
- ["BUNDLE_USER_CACHE", user_bundle_path.join("cache")]
- when "config"
- ["BUNDLE_USER_CONFIG", user_bundle_path.join("config")]
- when "plugin"
- ["BUNDLE_USER_PLUGIN", user_bundle_path.join("plugin")]
- else
- raise BundlerError, "Unknown user path requested: #{dir}"
- end
+ when "home"
+ ["BUNDLE_USER_HOME", Pathname.new(user_home).join(".bundle")]
+ when "cache"
+ ["BUNDLE_USER_CACHE", user_bundle_path.join("cache")]
+ when "config"
+ ["BUNDLE_USER_CONFIG", user_bundle_path.join("config")]
+ when "plugin"
+ ["BUNDLE_USER_PLUGIN", user_bundle_path.join("plugin")]
+ else
+ raise BundlerError, "Unknown user path requested: #{dir}"
+ end
# `fallback` will already be a Pathname, but Pathname.new() is
# idempotent so it's OK
Pathname.new(ENV.fetch(env_var, fallback))
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb
index 12db551eb3..94d4096cd3 100644
--- a/spec/bundler/bundler_spec.rb
+++ b/spec/bundler/bundler_spec.rb
@@ -283,7 +283,6 @@ EOF
expect(Bundler.user_bundle_path("config")).to eq(bundle_user_config_custom)
expect(Bundler.user_bundle_path("plugin")).to eq(bundle_user_plugin_custom)
end
-
end
end
end