summaryrefslogtreecommitdiff
path: root/lib/bundler/env.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-09-13 17:32:49 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-09-13 17:32:49 -0500
commit7378255261a0e33cbb14c94471a516b7aa7ef611 (patch)
treea99274647796411a9fdab87bff562de25c29d5eb /lib/bundler/env.rb
parentd07e39e8baee88ca8b82cc1fee263dcb68bd2179 (diff)
downloadbundler-7378255261a0e33cbb14c94471a516b7aa7ef611.tar.gz
[Env] Ensure output is platform-appropriate
Also, that everything is properly indented etc
Diffstat (limited to 'lib/bundler/env.rb')
-rw-r--r--lib/bundler/env.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index d42240247c..437dafc65f 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -88,12 +88,13 @@ module Bundler
def self.version_of(script)
return "not installed" unless Bundler.which(script)
- %x"#{script} --version"
+ `#{script} --version`
end
def self.chruby_version
return "not installed" unless Bundler.which("chruby-exec")
- %x"chruby-exec -- chruby --version".lines.grep(/^chruby:/).first
+ `chruby-exec -- chruby --version`.
+ sub(/.*^chruby: (#{Gem::Version::VERSION_PATTERN}).*/m, '\1')
end
def self.environment
@@ -106,7 +107,7 @@ module Bundler
out << [" Config Dir", Gem::ConfigFile::SYSTEM_CONFIG_PATH]
out << ["RubyGems", Gem::VERSION]
out << [" Gem Home", ENV.fetch("GEM_HOME") { Gem.dir }]
- out << [" Gem Path", ENV.fetch("GEM_PATH") { Gem.path.join(":") }]
+ out << [" Gem Path", ENV.fetch("GEM_PATH") { Gem.path.join(File::PATH_SEPARATOR) }]
out << [" User Path", Gem.user_dir]
out << [" Bin Dir", Gem.bindir]
out << ["OpenSSL"] if defined?(OpenSSL)
@@ -116,13 +117,13 @@ module Bundler
out << [" Cert Dir", OpenSSL::X509::DEFAULT_CERT_DIR] if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
out << ["Tools"]
out << [" Git", git_version]
- out << [" RVM", ENV.fetch("rvm_version"){ version_of("rvm") }]
+ out << [" RVM", ENV.fetch("rvm_version") { version_of("rvm") }]
out << [" rbenv", version_of("rbenv")]
out << [" chruby", chruby_version]
%w[rubygems-bundler open_gem].each do |name|
specs = Bundler.rubygems.find_name(name)
- out << [name, "(#{specs.map(&:version).join(",")})"] unless specs.empty?
+ out << [" #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
end
if (exe = caller.last.split(":").first) && exe =~ %r{(exe|bin)/bundler?\z}
shebang = File.read(exe).lines.first