Sha256: 9b5266e490367eadeefc47fbd1ffd410cb73076a252d7fd87ca9fb7a6d683d65

Contents?: true

Size: 764 Bytes

Versions: 12

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

module Diffend
  # Builds bundler definition used within the plugin
  module BuildBundlerDefinition
    class << self
      # Build clean instance of bundler definition, as we don't want to pollute the main one
      #
      # @param command [String] command executed via bundler
      # @param gemfile [String] path to Gemfile
      # @param lockfile [String] path to Gemfile.lock
      #
      # @return [Bundler::Definition]
      def call(command, gemfile, lockfile)
        unlock = command == 'update' ? true : nil

        Bundler.configure
        Bundler::Fetcher.disable_endpoint = nil

        Bundler::Definition
          .build(gemfile, lockfile, unlock)
          .tap(&:validate_runtime!)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
diffend-monitor-0.2.37 lib/diffend/build_bundler_definition.rb
diffend-0.2.37 lib/diffend/build_bundler_definition.rb
diffend-monitor-0.2.36 lib/diffend/build_bundler_definition.rb
diffend-0.2.36 lib/diffend/build_bundler_definition.rb
diffend-monitor-0.2.35 lib/diffend/build_bundler_definition.rb
diffend-0.2.35 lib/diffend/build_bundler_definition.rb
diffend-monitor-0.2.34 lib/diffend/build_bundler_definition.rb
diffend-0.2.34 lib/diffend/build_bundler_definition.rb
diffend-monitor-0.2.33 lib/diffend/build_bundler_definition.rb
diffend-0.2.33 lib/diffend/build_bundler_definition.rb
diffend-monitor-0.2.32 lib/diffend/build_bundler_definition.rb
diffend-0.2.32 lib/diffend/build_bundler_definition.rb