File: bundler_setup.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (25 lines) | stat: -rw-r--r-- 951 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

# Instead of requiring 'bundle/setup' directly, we need the following
# to make bundler more consistent when it comes to loading from
# bundler config. See the following links for more context:
# https://gitlab.com/gitlab-org/gitlab/-/issues/339939
# https://github.com/rubygems/rubygems/pull/4892
# https://github.com/rubygems/rubygems/issues/3363
require 'bundler'
ENV['BUNDLE_GEMFILE'] ||= Bundler.settings[:gemfile] || File.expand_path('../Gemfile', __dir__)
Bundler::SharedHelpers.set_env('BUNDLE_GEMFILE', ENV['BUNDLE_GEMFILE'])

if Bundler.respond_to?(:reset_settings_and_root!)
  Bundler.reset_settings_and_root!
else
  # Bundler 2.1.4 does not have this method. Do the same as Bundler 2.2.26
  # https://github.com/rubygems/rubygems/blob/bundler-v2.2.26/bundler/lib/bundler.rb#L612-L615
  Bundler.instance_eval do
    @settings = nil
    @root = nil
  end
end

require 'bundler/setup'
require 'google/protobuf'