Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Conform to code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Werbin committed Sep 11, 2017
1 parent bea2797 commit abb8f97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,19 @@ def tmp_home_path(login, warning)
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))
Expand Down
1 change: 0 additions & 1 deletion spec/bundler/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@
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

0 comments on commit abb8f97

Please sign in to comment.