summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-14 13:23:55 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-15 15:09:48 +0200
commitc26781539a3b12385a6905cc428d4001dd668e77 (patch)
treea351fd329c638efff71aa156517267f4cc9fb8a7
parent65f63305a295f5ce10710235cbe83359fde65157 (diff)
downloadbundler-c26781539a3b12385a6905cc428d4001dd668e77.tar.gz
Add user home to `bundle env`
-rw-r--r--lib/bundler/env.rb1
-rw-r--r--spec/bundler/env_spec.rb7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 9cd9b8baca..80974b67ce 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -102,6 +102,7 @@ module Bundler
out << ["RubyGems", Gem::VERSION]
out << [" Gem Home", ENV.fetch("GEM_HOME") { Gem.dir }]
out << [" Gem Path", ENV.fetch("GEM_PATH") { Gem.path.join(File::PATH_SEPARATOR) }]
+ out << [" User Home", Gem.user_home]
out << [" User Path", Gem.user_dir]
out << [" Bin Dir", Gem.bindir]
if defined?(OpenSSL)
diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb
index 3d42c6df02..8323a9a7b3 100644
--- a/spec/bundler/env_spec.rb
+++ b/spec/bundler/env_spec.rb
@@ -33,6 +33,13 @@ RSpec.describe Bundler::Env do
end
end
+ it "prints user home" do
+ with_clear_paths("HOME", "/a/b/c") do
+ out = described_class.report
+ expect(out).to include("User Home /a/b/c")
+ end
+ end
+
it "prints user path" do
with_clear_paths("HOME", "/a/b/c") do
out = described_class.report