Module: Datadog::CI::Utils::Bundle

Defined in:
lib/datadog/ci/utils/bundle.rb

Class Method Summary collapse

Class Method Details

.locationObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/datadog/ci/utils/bundle.rb', line 10

def self.location
  require "bundler"
  bundle_path = Bundler.bundle_path.to_s
  bundle_path if bundle_path&.start_with?(Datadog::CI::Git::LocalRepository.root)
rescue => e
  Datadog.logger.warn("Failed to find bundled gems location: #{e}")

  Ext::Environment::POSSIBLE_BUNDLE_LOCATIONS.each do |location|
    path = File.join(Datadog::CI::Git::LocalRepository.root, location)
    return path if File.directory?(path)
  end
  nil
end