summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2018-09-25 04:24:58 +0000
committerBundlerbot <bot@bundler.io>2018-09-25 04:24:58 +0000
commit0d7259e69951b5d6f99f4ddd082508d7ef38fce9 (patch)
treedc25a77ae517155643ce23111228238771b41c32
parent1bd53e3d930e4f915db5536c68b1ed7282304045 (diff)
parent2bb4455bd78c3ab028240de531d7c373d8225e31 (diff)
downloadbundler-0d7259e69951b5d6f99f4ddd082508d7ef38fce9.tar.gz
Merge #6686
6686: Output OpenSSL information only when OpenSSL is available. r=segiddins a=voxik It seems that only single OpenSSL availability check should be enough to output or not output the OpenSSL information. I split this into two commits, so you can cherry-pick, in case you want to be more cautious about the availability of specific constants, but since they were introduced in Ruby 1.8.0 (https://github.com/ruby/ruby/commit/78ff3833fb67c8005a9b851037e7), I would not bother. Please note that that this code was pointed out by Coverity scanner (although it is definitely not an error): ~~~ Error: FORWARD_NULL (CWE-476): rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/env.rb:113: null_check: Calling "defined?(OpenSSL)" implies that "OpenSSL" might be null-like. rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/env.rb:114: property_access: Accessing a property of null-like value "OpenSSL". # 112| out << [" Bin Dir", Gem.bindir] # 113| out << ["OpenSSL"] if defined?(OpenSSL) # 114|-> out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION) # 115| out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION) # 116| out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE) ~~~ Co-authored-by: Vít Ondruch <vondruch@redhat.com>
-rw-r--r--lib/bundler/env.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 171b6520ad..51738139fa 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -110,11 +110,13 @@ module Bundler
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)
- out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
- out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
- out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
- out << [" Cert Dir", OpenSSL::X509::DEFAULT_CERT_DIR] if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
+ if defined?(OpenSSL)
+ out << ["OpenSSL"]
+ out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
+ out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
+ out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
+ out << [" Cert Dir", OpenSSL::X509::DEFAULT_CERT_DIR] if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
+ end
out << ["Tools"]
out << [" Git", git_version]
out << [" RVM", ENV.fetch("rvm_version") { version_of("rvm") }]