Flowdock
method

environment

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Env
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?

Method not available on this version

This method is only available on newer versions. The first available version of the method is shown here.

environment() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/bundler/env.rb, line 100
    def self.environment
      out = []

      out << ["Bundler", Bundler::VERSION]
      out << ["  Platforms", Gem.platforms.join(", ")]
      out << ["Ruby", ruby_version]
      out << ["  Full Path", Gem.ruby]
      out << ["  Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname]
      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 Path", Gem.user_dir]
      out << ["  Bin Dir", Gem.bindir]
      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") }]
      out << ["  rbenv", version_of("rbenv")]
      out << ["  chruby", chruby_version]

      ]rubygems-bundler open_gem].each do |name|
        specs = Bundler.rubygems.find_name(name)
        out << ["  #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
      end
      if (exe = caller.last.split(":").first) && exe =~ %{(exe|bin)/bundler?\z}
        shebang = File.read(exe).lines.first
        shebang.sub!(/^#!\s*/, "")
        unless shebang.start_with?(Gem.ruby, "/usr/bin/env ruby")
          out << ["Gem.ruby", Gem.ruby]
          out << ["bundle #!", shebang]
        end
      end

      out
    end
Register or log in to add new notes.