<commit_before># frozen_string_literal: true
require "bundler/rubygems_integration"
require "bundler/source/git/git_proxy"

module Bundler
  class Env
    def self.write(io)
      io.write report
    end

    def self.report(options = {})
      print_gemfile = options.delete(:print_gemfile) { true }
      print_gemspecs = options.delete(:print_gemspecs) { true }

      out = String.new("## Environment\n\n```\n")
      out << "Bundler   #{Bundler::VERSION}\n"
      out << "RubyGems  #{Gem::VERSION}\n"
      out << "Ruby      #{ruby_version}"
      out << "GEM_HOME  #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
      out << "GEM_PATH  #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
      out << "RVM       #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
      out << "Git       #{git_version}\n"
      out << "Platform  #{Gem::Platform.local}\n"
      out << "OpenSSL   #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
      %w[rubygems-bundler open_gem].each do |name|
        specs = Bundler.rubygems.find_name(name)
        out << "#{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
      end

      out << "```\n"

      out << "\n## Bundler settings\n\n```\n" unless Bundler.settings.all.empty?
      Bundler.settings.all.each do |setting|
        out << setting << "\n"
        Bundler.settings.pretty_values_for(setting).each do |line|
          out << "  " << line << "\n"
        end
      end
      out << "```\n"

      return out unless SharedHelpers.in_bundle?

      if print_gemfile
        out << "\n## Gemfile\n"<commit_msg>Auto merge of #5679 - bundler:seg-env-no-settings, r=indirect<commit_after># frozen_string_literal: true
require "bundler/rubygems_integration"
require "bundler/source/git/git_proxy"

module Bundler
  class Env
    def self.write(io)
      io.write report
    end

    def self.report(options = {})
      print_gemfile = options.delete(:print_gemfile) { true }
      print_gemspecs = options.delete(:print_gemspecs) { true }

      out = String.new("## Environment\n\n```\n")
      out << "Bundler   #{Bundler::VERSION}\n"
      out << "RubyGems  #{Gem::VERSION}\n"
      out << "Ruby      #{ruby_version}"
      out << "GEM_HOME  #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
      out << "GEM_PATH  #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
      out << "RVM       #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
      out << "Git       #{git_version}\n"
      out << "Platform  #{Gem::Platform.local}\n"
      out << "OpenSSL   #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
      %w[rubygems-bundler open_gem].each do |name|
        specs = Bundler.rubygems.find_name(name)
        out << "#{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
      end

      out << "```\n"

      unless Bundler.settings.all.empty?
        out << "\n## Bundler settings\n\n```\n"
        Bundler.settings.all.each do |setting|
          out << setting << "\n"
          Bundler.settings.pretty_values_for(setting).each do |line|
            out << "  " << line << "\n"
          end
        end
        out << "```\n"
      end

      return out unless SharedHelpers.in_bundle?

      if print_gemfile
        out << "\n## Gemfile\n"
{'fraction_non_alphanumeric': 0.1743559017375674, 'fraction_numerical': 0.0011983223487118035, 'mean_word_length': 2.71, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1731850', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1184, 'n_words': 223}