diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-22 21:07:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-22 21:07:08 +0300 |
commit | b486760a6332905cd2ac94b3fade5cbc6a55d21e (patch) | |
tree | 0f1206f20aa3f1d49ddfee1418538c1777ef0957 /vendor | |
parent | aaf158bcb57386a043d8cb7dc491a2f306a4ac13 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'vendor')
12 files changed, 46 insertions, 50 deletions
diff --git a/vendor/gems/bundler-checksum/README.md b/vendor/gems/bundler-checksum/README.md index 1420dc49b94..675c3ad2ee8 100644 --- a/vendor/gems/bundler-checksum/README.md +++ b/vendor/gems/bundler-checksum/README.md @@ -9,7 +9,7 @@ Add the following to your Gemfile: ``` if ENV['BUNDLER_CHECKSUM_VERIFICATION_OPT_IN'] # this verification is still experimental require 'bundler-checksum' - Bundler::Checksum.patch! + BundlerChecksum.patch! end ``` diff --git a/vendor/gems/bundler-checksum/bin/bundler-checksum b/vendor/gems/bundler-checksum/bin/bundler-checksum index 2d0aea827bc..0ef2748a518 100755 --- a/vendor/gems/bundler-checksum/bin/bundler-checksum +++ b/vendor/gems/bundler-checksum/bin/bundler-checksum @@ -1,6 +1,6 @@ #!/usr/bin/env ruby require 'bundler-checksum' -require 'bundler/checksum/command' +require 'bundler_checksum/command' -Bundler::Checksum::Command.execute(ARGV) +BundlerChecksum::Command.execute(ARGV) diff --git a/vendor/gems/bundler-checksum/bundler-checksum.gemspec b/vendor/gems/bundler-checksum/bundler-checksum.gemspec index c04312480b6..b9667570549 100644 --- a/vendor/gems/bundler-checksum/bundler-checksum.gemspec +++ b/vendor/gems/bundler-checksum/bundler-checksum.gemspec @@ -1,10 +1,10 @@ # frozen_string_literal: true -require_relative 'lib/bundler/checksum/version' +require_relative 'lib/bundler_checksum/version' Gem::Specification.new do |spec| spec.name = 'bundler-checksum' - spec.version = Bundler::Checksum::VERSION + spec.version = BundlerChecksum::VERSION spec.authors = ['dustinmm80'] spec.email = ['dcollins@gitlab.com'] diff --git a/vendor/gems/bundler-checksum/lib/bundler-checksum.rb b/vendor/gems/bundler-checksum/lib/bundler-checksum.rb index 600cd4f7107..c2abf1b41d6 100644 --- a/vendor/gems/bundler-checksum/lib/bundler-checksum.rb +++ b/vendor/gems/bundler-checksum/lib/bundler-checksum.rb @@ -1 +1 @@ -require 'bundler/checksum' +require 'bundler_checksum' diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb deleted file mode 100644 index 41e958b2db9..00000000000 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Bundler - module Checksum - # bundler-checksum version - VERSION = '0.1.0' - end -end diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum.rb index 40c42644964..b3d36521f24 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'bundler' -require 'bundler/checksum/version' +require 'bundler_checksum/version' require 'json' module Bundler @@ -27,7 +27,7 @@ module Bundler end def fetch_checksum_from_file(spec) - ::Bundler::Checksum.checksum_for(spec.name, spec.version.to_s, spec.platform.to_s) + ::BundlerChecksum.checksum_for(spec.name, spec.version.to_s, spec.platform.to_s) end # Modified from @@ -74,37 +74,35 @@ module Bundler end end -module Bundler - module Checksum - class << self - def checksum_file - @checksum_file ||= File.join(File.dirname(Bundler.default_gemfile), 'Gemfile.checksum') - end - - def checksums_from_file - @checksums_from_file ||= JSON.parse(File.open(checksum_file).read, symbolize_names: true) - rescue JSON::ParserError => e - raise "Invalid checksum file: #{e.message}" - end +module BundlerChecksum + class << self + def checksum_file + @checksum_file ||= File.join(File.dirname(Bundler.default_gemfile), 'Gemfile.checksum') + end - def checksum_for(gem_name, gem_version, gem_platform) - item = checksums_from_file.detect do |item| - item[:name] == gem_name && - item[:platform] == gem_platform && - item[:version] == gem_version - end + def checksums_from_file + @checksums_from_file ||= JSON.parse(File.open(checksum_file).read, symbolize_names: true) + rescue JSON::ParserError => e + raise "Invalid checksum file: #{e.message}" + end - item&.fetch(:checksum) + def checksum_for(gem_name, gem_version, gem_platform) + item = checksums_from_file.detect do |item| + item[:name] == gem_name && + item[:platform] == gem_platform && + item[:version] == gem_version end - def patch! - return if defined?(@patched) && @patched - @patched = true + item&.fetch(:checksum) + end - Bundler.ui.info "Patching bundler with bundler-checksum..." - require 'bundler/rubygems_gem_installer' - ::Bundler::RubyGemsGemInstaller.prepend(Bundler::Patches::RubyGemsInstallerPatch) - end + def patch! + return if defined?(@patched) && @patched + @patched = true + + Bundler.ui.info "Patching bundler with bundler-checksum..." + require 'bundler/rubygems_gem_installer' + ::Bundler::RubyGemsGemInstaller.prepend(Bundler::Patches::RubyGemsInstallerPatch) end end end diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum/command.rb index 438f41f6e69..c6c71431538 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum/command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Bundler::Checksum +module BundlerChecksum module Command autoload :Init, File.expand_path("command/init", __dir__) autoload :Verify, File.expand_path("command/verify", __dir__) diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/helper.rb index fa06bfe3da4..515f5926106 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/helper.rb @@ -3,7 +3,7 @@ require 'json' require 'net/http' -module Bundler::Checksum::Command +module BundlerChecksum::Command module Helper extend self diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/init.rb index 47a9b676f1d..1d8db7d78fa 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/init.rb @@ -2,7 +2,7 @@ require 'openssl' -module Bundler::Checksum::Command +module BundlerChecksum::Command module Init extend self @@ -65,14 +65,14 @@ module Bundler::Checksum::Command def previous_checksums @previous_checksums ||= if File.exist?(checksum_file) - ::Bundler::Checksum.checksums_from_file + ::BundlerChecksum.checksums_from_file else [] end end def checksum_file - ::Bundler::Checksum.checksum_file + ::BundlerChecksum.checksum_file end def lockfile diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/verify.rb index ba2eea6ea0c..e6a52ded42c 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum/command/verify.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Bundler::Checksum::Command +module BundlerChecksum::Command module Verify extend self @@ -27,7 +27,7 @@ module Bundler::Checksum::Command private def local_checksums - ::Bundler::Checksum.checksums_from_file + ::BundlerChecksum.checksums_from_file end def validate_gem_checksum(gem_name, gem_version, gem_platform, local_checksum) diff --git a/vendor/gems/bundler-checksum/lib/bundler_checksum/version.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum/version.rb new file mode 100644 index 00000000000..367a9e49a47 --- /dev/null +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum/version.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module BundlerChecksum + # bundler-checksum version + VERSION = '0.1.0' +end diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile index 238bd09669f..503cf4587fa 100644 --- a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile +++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' if ENV['BUNDLER_CHECKSUM_VERIFICATION_OPT_IN'] # this verification is still experimental $:.unshift(File.expand_path('../../lib', __dir__)) require 'bundler-checksum' - Bundler::Checksum.patch! + BundlerChecksum.patch! end gem 'rails', '~> 6.1.6.1' |