Sha256: fcf199f8585adb1580ec83dd7f16616061be7752bbc73c1d3118d14af0e0b765

Contents?: true

Size: 767 Bytes

Versions: 8

Compression:

Stored size: 767 Bytes

Contents

require "aruba/api/environment"
require "bundler"

module Aruba
  module Api
    module Bundler
      include Environment

      # Unset variables used by bundler
      def unset_bundler_env_vars
        empty_env = with_environment { with_unbundled_env { ENV.to_h } }
        aruba_env = aruba.environment.to_h
        (aruba_env.keys - empty_env.keys).each do |key|
          delete_environment_variable key
        end
        empty_env.each do |k, v|
          set_environment_variable k, v
        end
      end

      private

      def with_unbundled_env(&block)
        if ::Bundler.respond_to?(:with_unbundled_env)
          ::Bundler.with_unbundled_env(&block)
        else
          ::Bundler.with_clean_env(&block)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/api/bundler.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/api/bundler.rb
aruba-2.2.0 lib/aruba/api/bundler.rb
aruba-2.1.0 lib/aruba/api/bundler.rb
aruba-2.0.1 lib/aruba/api/bundler.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/aruba-2.0.0/lib/aruba/api/bundler.rb
aruba-2.0.0 lib/aruba/api/bundler.rb
aruba-1.1.2 lib/aruba/api/bundler.rb