dependabot-bundler 0.138.1 → 0.138.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/v2/.gitignore +1 -2
- data/helpers/v2/build +2 -2
- data/helpers/v2/lib/functions.rb +51 -3
- data/helpers/v2/lib/functions/file_parser.rb +106 -0
- data/helpers/v2/monkey_patches/definition_bundler_version_patch.rb +15 -0
- data/helpers/v2/monkey_patches/definition_ruby_version_patch.rb +20 -0
- data/helpers/v2/monkey_patches/git_source_patch.rb +62 -0
- data/helpers/v2/spec/functions/file_parser_spec.rb +142 -0
- data/helpers/v2/spec/functions_spec.rb +0 -3
- data/helpers/v2/spec/native_spec_helper.rb +1 -2
- data/helpers/v2/spec/shared_contexts.rb +60 -0
- metadata +10 -5
- data/helpers/v2/.bundle/config +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eb2653cea8a396b9d65f20ea24e8680bdcb0909c2e28ad045beca904f2a984b
|
4
|
+
data.tar.gz: d7ffc19ecc9db88a04e5222f132e18f94f353eb806ef454d0e958c531531dbd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28ea0b95452a1c7bc2cf7fe5d3c211c678a89d5b062f7184dc23fd06dd5f8df8a61ccd9e66abb3a807fc10958f74623245ef4809830600a44ce6472095ce369a
|
7
|
+
data.tar.gz: 46c21b5dbc8ddaac57a40c1a6e48c16427562c829d6b29879a5b1b6d77b9d3c16ebdef515ef32c6f71d4c57c4feeed57ff22ee7f78a6839991e3444cefd44181
|
data/helpers/v2/.gitignore
CHANGED
data/helpers/v2/build
CHANGED
@@ -10,7 +10,6 @@ fi
|
|
10
10
|
|
11
11
|
helpers_dir="$(dirname "${BASH_SOURCE[0]}")"
|
12
12
|
cp -r \
|
13
|
-
"$helpers_dir/.bundle" \
|
14
13
|
"$helpers_dir/lib" \
|
15
14
|
"$helpers_dir/run.rb" \
|
16
15
|
"$helpers_dir/Gemfile" \
|
@@ -20,4 +19,5 @@ cd "$install_dir"
|
|
20
19
|
|
21
20
|
# NOTE: Sets `BUNDLED WITH` to match the installed v1 version in Gemfile.lock
|
22
21
|
# forcing specs and native helpers to run with the same version
|
23
|
-
BUNDLER_VERSION=2 bundle
|
22
|
+
BUNDLER_VERSION=2 bundle config set --local path ".bundle"
|
23
|
+
BUNDLER_VERSION=2 bundle install --without test
|
data/helpers/v2/lib/functions.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
|
+
require "functions/file_parser"
|
2
|
+
|
1
3
|
module Functions
|
2
4
|
class NotImplementedError < StandardError; end
|
3
5
|
|
4
6
|
def self.parsed_gemfile(lockfile_name:, gemfile_name:, dir:)
|
5
|
-
|
7
|
+
set_bundler_flags_and_credentials(dir: dir, credentials: [],
|
8
|
+
using_bundler2: false)
|
9
|
+
FileParser.new(lockfile_name: lockfile_name).
|
10
|
+
parsed_gemfile(gemfile_name: gemfile_name)
|
6
11
|
end
|
7
12
|
|
8
13
|
def self.parsed_gemspec(lockfile_name:, gemspec_name:, dir:)
|
9
|
-
|
14
|
+
set_bundler_flags_and_credentials(dir: dir, credentials: [],
|
15
|
+
using_bundler2: false)
|
16
|
+
FileParser.new(lockfile_name: lockfile_name).
|
17
|
+
parsed_gemspec(gemspec_name: gemspec_name)
|
10
18
|
end
|
11
19
|
|
12
20
|
def self.vendor_cache_dir(dir:)
|
@@ -57,7 +65,47 @@ module Functions
|
|
57
65
|
|
58
66
|
def self.set_bundler_flags_and_credentials(dir:, credentials:,
|
59
67
|
using_bundler2:)
|
60
|
-
|
68
|
+
dir = dir ? Pathname.new(dir) : dir
|
69
|
+
Bundler.instance_variable_set(:@root, dir)
|
70
|
+
|
71
|
+
# Remove installed gems from the default Rubygems index
|
72
|
+
Gem::Specification.all =
|
73
|
+
Gem::Specification.send(:default_stubs, "*.gemspec")
|
74
|
+
|
75
|
+
# Set auth details
|
76
|
+
relevant_credentials(credentials).each do |cred|
|
77
|
+
token = cred["token"] ||
|
78
|
+
"#{cred['username']}:#{cred['password']}"
|
79
|
+
|
80
|
+
Bundler.settings.set_command_option(
|
81
|
+
cred.fetch("host"),
|
82
|
+
token.gsub("@", "%40F").gsub("?", "%3F")
|
83
|
+
)
|
84
|
+
end
|
85
|
+
|
86
|
+
# NOTE: Prevent bundler from printing resolution information
|
87
|
+
Bundler.ui = Bundler::UI::Silent.new
|
88
|
+
|
89
|
+
# Use HTTPS for GitHub if lockfile
|
90
|
+
Bundler.settings.set_command_option("forget_cli_options", "true")
|
91
|
+
Bundler.settings.set_command_option("github.https", "true")
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.relevant_credentials(credentials)
|
95
|
+
[
|
96
|
+
*git_source_credentials(credentials),
|
97
|
+
*private_registry_credentials(credentials)
|
98
|
+
].select { |cred| cred["password"] || cred["token"] }
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.private_registry_credentials(credentials)
|
102
|
+
credentials.
|
103
|
+
select { |cred| cred["type"] == "rubygems_server" }
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.git_source_credentials(credentials)
|
107
|
+
credentials.
|
108
|
+
select { |cred| cred["type"] == "git_source" }
|
61
109
|
end
|
62
110
|
|
63
111
|
def self.conflicting_dependencies(dir:, dependency_name:, target_version:,
|
@@ -0,0 +1,106 @@
|
|
1
|
+
module Functions
|
2
|
+
class FileParser
|
3
|
+
def initialize(lockfile_name:)
|
4
|
+
@lockfile_name = lockfile_name
|
5
|
+
end
|
6
|
+
|
7
|
+
attr_reader :lockfile_name
|
8
|
+
|
9
|
+
def parsed_gemfile(gemfile_name:)
|
10
|
+
Bundler::Definition.build(gemfile_name, nil, {}).
|
11
|
+
dependencies.select(&:current_platform?).
|
12
|
+
reject { |dep| dep.source.is_a?(Bundler::Source::Gemspec) }.
|
13
|
+
map(&method(:serialize_bundler_dependency))
|
14
|
+
end
|
15
|
+
|
16
|
+
def parsed_gemspec(gemspec_name:)
|
17
|
+
Bundler.load_gemspec_uncached(gemspec_name).
|
18
|
+
dependencies.
|
19
|
+
map(&method(:serialize_bundler_dependency))
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def lockfile
|
25
|
+
return @lockfile if defined?(@lockfile)
|
26
|
+
|
27
|
+
@lockfile =
|
28
|
+
begin
|
29
|
+
return unless lockfile_name && File.exist?(lockfile_name)
|
30
|
+
|
31
|
+
File.read(lockfile_name)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def parsed_lockfile
|
36
|
+
return unless lockfile
|
37
|
+
|
38
|
+
@parsed_lockfile ||= Bundler::LockfileParser.new(lockfile)
|
39
|
+
end
|
40
|
+
|
41
|
+
def source_from_lockfile(dependency_name)
|
42
|
+
parsed_lockfile&.specs.find { |s| s.name == dependency_name }&.source
|
43
|
+
end
|
44
|
+
|
45
|
+
def source_for(dependency)
|
46
|
+
source = dependency.source
|
47
|
+
if lockfile && default_rubygems?(source)
|
48
|
+
# If there's a lockfile and the Gemfile doesn't have anything
|
49
|
+
# interesting to say about the source, check that.
|
50
|
+
source = source_from_lockfile(dependency.name)
|
51
|
+
end
|
52
|
+
raise "Bad source: #{source}" unless sources.include?(source.class)
|
53
|
+
|
54
|
+
return nil if default_rubygems?(source)
|
55
|
+
|
56
|
+
details = { type: source.class.name.split("::").last.downcase }
|
57
|
+
if source.is_a?(Bundler::Source::Git)
|
58
|
+
details.merge!(git_source_details(source))
|
59
|
+
end
|
60
|
+
if source.is_a?(Bundler::Source::Rubygems)
|
61
|
+
details[:url] = source.remotes.first.to_s
|
62
|
+
end
|
63
|
+
details
|
64
|
+
end
|
65
|
+
|
66
|
+
# TODO: Remove default `master` branch
|
67
|
+
def git_source_details(source)
|
68
|
+
{
|
69
|
+
url: source.uri,
|
70
|
+
branch: source.branch || "master",
|
71
|
+
ref: source.ref || "master"
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
def default_rubygems?(source)
|
76
|
+
return true if source.nil?
|
77
|
+
return false unless source.is_a?(Bundler::Source::Rubygems)
|
78
|
+
|
79
|
+
source.remotes.any? { |r| r.to_s.include?("rubygems.org") }
|
80
|
+
end
|
81
|
+
|
82
|
+
def serialize_bundler_dependency(dependency)
|
83
|
+
{
|
84
|
+
name: dependency.name,
|
85
|
+
requirement: dependency.requirement,
|
86
|
+
groups: dependency.groups,
|
87
|
+
source: source_for(dependency),
|
88
|
+
type: dependency.type
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
# Can't be a constant because some of these don't exist in bundler
|
93
|
+
# 1.15, which used to cause issues on Heroku (causing exception on boot).
|
94
|
+
# TODO: Check if this will be an issue with multiple bundler versions
|
95
|
+
def sources
|
96
|
+
[
|
97
|
+
NilClass,
|
98
|
+
Bundler::Source::Rubygems,
|
99
|
+
Bundler::Source::Git,
|
100
|
+
Bundler::Source::Path,
|
101
|
+
Bundler::Source::Gemspec,
|
102
|
+
Bundler::Source::Metadata
|
103
|
+
]
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/definition"
|
4
|
+
|
5
|
+
# Ignore the Bundler version specified in the Gemfile (since the only Bundler
|
6
|
+
# version available to us is the one we're using).
|
7
|
+
module BundlerDefinitionBundlerVersionPatch
|
8
|
+
def expanded_dependencies
|
9
|
+
@expanded_dependencies ||=
|
10
|
+
expand_dependencies(dependencies + metadata_dependencies, @remote).
|
11
|
+
reject { |d| d.name == "bundler" }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Bundler::Definition.prepend(BundlerDefinitionBundlerVersionPatch)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/definition"
|
4
|
+
|
5
|
+
module BundlerDefinitionRubyVersionPatch
|
6
|
+
def index
|
7
|
+
@index ||= super.tap do
|
8
|
+
if ruby_version
|
9
|
+
requested_version = ruby_version.to_gem_version_with_patchlevel
|
10
|
+
sources.metadata_source.specs <<
|
11
|
+
Gem::Specification.new("ruby\0", requested_version)
|
12
|
+
end
|
13
|
+
|
14
|
+
sources.metadata_source.specs <<
|
15
|
+
Gem::Specification.new("ruby\0", "2.5.3p105")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Bundler::Definition.prepend(BundlerDefinitionRubyVersionPatch)
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/source"
|
4
|
+
|
5
|
+
module Bundler
|
6
|
+
class Source
|
7
|
+
class Git
|
8
|
+
class GitProxy
|
9
|
+
private
|
10
|
+
|
11
|
+
# Bundler allows ssh authentication when talking to GitHub but there's
|
12
|
+
# no way for Dependabot to do so (it doesn't have any ssh keys).
|
13
|
+
# Instead, we convert all `git@github.com:` URLs to use HTTPS.
|
14
|
+
def configured_uri_for(uri)
|
15
|
+
uri = uri.gsub(%r{git@(.*?):/?}, 'https://\1/')
|
16
|
+
if /https?:/ =~ uri
|
17
|
+
remote = Bundler::URI(uri)
|
18
|
+
config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
|
19
|
+
remote.userinfo ||= config_auth
|
20
|
+
remote.to_s
|
21
|
+
else
|
22
|
+
uri
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module Bundler
|
31
|
+
class Source
|
32
|
+
class Git < Path
|
33
|
+
private
|
34
|
+
|
35
|
+
def serialize_gemspecs_in(destination)
|
36
|
+
original_load_paths = $LOAD_PATH.dup
|
37
|
+
reduced_load_paths = original_load_paths.
|
38
|
+
reject { |p| p.include?("/gems/") }
|
39
|
+
|
40
|
+
$LOAD_PATH.shift until $LOAD_PATH.empty?
|
41
|
+
reduced_load_paths.each { |p| $LOAD_PATH << p }
|
42
|
+
|
43
|
+
if destination.relative?
|
44
|
+
destination = destination.expand_path(Bundler.root)
|
45
|
+
end
|
46
|
+
Dir["#{destination}/#{@glob}"].each do |spec_path|
|
47
|
+
# Evaluate gemspecs and cache the result. Gemspecs
|
48
|
+
# in git might require git or other dependencies.
|
49
|
+
# The gemspecs we cache should already be evaluated.
|
50
|
+
spec = Bundler.load_gemspec(spec_path)
|
51
|
+
next unless spec
|
52
|
+
|
53
|
+
Bundler.rubygems.set_installed_by_version(spec)
|
54
|
+
Bundler.rubygems.validate(spec)
|
55
|
+
File.open(spec_path, "wb") { |file| file.write(spec.to_ruby) }
|
56
|
+
end
|
57
|
+
$LOAD_PATH.shift until $LOAD_PATH.empty?
|
58
|
+
original_load_paths.each { |p| $LOAD_PATH << p }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "native_spec_helper"
|
4
|
+
require "shared_contexts"
|
5
|
+
|
6
|
+
RSpec.describe Functions::FileParser do
|
7
|
+
include_context "in a temporary bundler directory"
|
8
|
+
|
9
|
+
let(:dependency_source) do
|
10
|
+
described_class.new(
|
11
|
+
lockfile_name: "Gemfile.lock"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:project_name) { "gemfile" }
|
16
|
+
|
17
|
+
describe "#parsed_gemfile" do
|
18
|
+
subject(:parsed_gemfile) do
|
19
|
+
in_tmp_folder do
|
20
|
+
dependency_source.parsed_gemfile(gemfile_name: "Gemfile")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "parses gemfile" do
|
25
|
+
parsed_gemfile = [
|
26
|
+
{
|
27
|
+
groups: [:default],
|
28
|
+
name: "business",
|
29
|
+
requirement: Gem::Requirement.new("~> 1.4.0"),
|
30
|
+
source: nil,
|
31
|
+
type: :runtime
|
32
|
+
},
|
33
|
+
{
|
34
|
+
groups: [:default],
|
35
|
+
name: "statesman",
|
36
|
+
requirement: Gem::Requirement.new("~> 1.2.0"),
|
37
|
+
source: nil,
|
38
|
+
type: :runtime
|
39
|
+
}
|
40
|
+
]
|
41
|
+
is_expected.to eq(parsed_gemfile)
|
42
|
+
end
|
43
|
+
|
44
|
+
context "with a git source" do
|
45
|
+
let(:project_name) { "git_source" }
|
46
|
+
|
47
|
+
it "parses gemfile" do
|
48
|
+
parsed_gemfile = [
|
49
|
+
{
|
50
|
+
groups: [:default],
|
51
|
+
name: "business",
|
52
|
+
requirement: Gem::Requirement.new("~> 1.6.0"),
|
53
|
+
source: {
|
54
|
+
branch: "master",
|
55
|
+
ref: "a1b78a9",
|
56
|
+
type: "git",
|
57
|
+
url: "git@github.com:gocardless/business"
|
58
|
+
},
|
59
|
+
type: :runtime
|
60
|
+
},
|
61
|
+
{
|
62
|
+
groups: [:default],
|
63
|
+
name: "statesman",
|
64
|
+
requirement: Gem::Requirement.new("~> 1.2.0"),
|
65
|
+
source: nil,
|
66
|
+
type: :runtime
|
67
|
+
},
|
68
|
+
{
|
69
|
+
groups: [:default],
|
70
|
+
name: "prius",
|
71
|
+
requirement: Gem::Requirement.new(">= 0"),
|
72
|
+
source: {
|
73
|
+
branch: "master",
|
74
|
+
ref: "master",
|
75
|
+
type: "git",
|
76
|
+
url: "https://github.com/gocardless/prius"
|
77
|
+
},
|
78
|
+
type: :runtime
|
79
|
+
},
|
80
|
+
{
|
81
|
+
groups: [:default],
|
82
|
+
name: "que",
|
83
|
+
requirement: Gem::Requirement.new(">= 0"),
|
84
|
+
source: {
|
85
|
+
branch: "master",
|
86
|
+
ref: "v0.11.6",
|
87
|
+
type: "git",
|
88
|
+
url: "git@github.com:chanks/que"
|
89
|
+
},
|
90
|
+
type: :runtime
|
91
|
+
},
|
92
|
+
{
|
93
|
+
groups: [:default],
|
94
|
+
name: "uk_phone_numbers",
|
95
|
+
requirement: Gem::Requirement.new(">= 0"),
|
96
|
+
source: {
|
97
|
+
branch: "master",
|
98
|
+
ref: "master",
|
99
|
+
type: "git",
|
100
|
+
url: "http://github.com/gocardless/uk_phone_numbers"
|
101
|
+
},
|
102
|
+
type: :runtime
|
103
|
+
}
|
104
|
+
]
|
105
|
+
is_expected.to eq(parsed_gemfile)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe "#parsed_gemspec" do
|
111
|
+
let!(:gemspec_fixture) do
|
112
|
+
fixture("ruby", "gemspecs", "exact")
|
113
|
+
end
|
114
|
+
|
115
|
+
subject(:parsed_gemspec) do
|
116
|
+
in_tmp_folder do |tmp_path|
|
117
|
+
File.write(File.join(tmp_path, "test.gemspec"), gemspec_fixture)
|
118
|
+
dependency_source.parsed_gemspec(gemspec_name: "test.gemspec")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it "parses gemspec" do
|
123
|
+
parsed_gemspec = [
|
124
|
+
{
|
125
|
+
groups: nil,
|
126
|
+
name: "business",
|
127
|
+
requirement: Gem::Requirement.new("= 1.0.0"),
|
128
|
+
source: nil,
|
129
|
+
type: :runtime
|
130
|
+
},
|
131
|
+
{
|
132
|
+
groups: nil,
|
133
|
+
name: "statesman",
|
134
|
+
requirement: Gem::Requirement.new("= 1.0.0"),
|
135
|
+
source: nil,
|
136
|
+
type: :runtime
|
137
|
+
}
|
138
|
+
]
|
139
|
+
is_expected.to eq(parsed_gemspec)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -5,8 +5,6 @@ require "native_spec_helper"
|
|
5
5
|
RSpec.describe Functions do
|
6
6
|
# Verify v1 method signatures are exist, but raise as NYI
|
7
7
|
{
|
8
|
-
parsed_gemfile: [ :lockfile_name, :gemfile_name, :dir ],
|
9
|
-
parsed_gemspec: [ :lockfile_name, :gemspec_name, :dir ],
|
10
8
|
vendor_cache_dir: [ :dir ],
|
11
9
|
update_lockfile: [ :dir, :gemfile_name, :lockfile_name, :using_bundler2, :credentials, :dependencies ],
|
12
10
|
force_update: [ :dir, :dependency_name, :target_version, :gemfile_name, :lockfile_name, :using_bundler2,
|
@@ -19,7 +17,6 @@ RSpec.describe Functions do
|
|
19
17
|
:dir, :credentials],
|
20
18
|
jfrog_source: [:dir, :gemfile_name, :credentials, :using_bundler2],
|
21
19
|
git_specs: [:dir, :gemfile_name, :credentials, :using_bundler2],
|
22
|
-
set_bundler_flags_and_credentials: [:dir, :credentials, :using_bundler2],
|
23
20
|
conflicting_dependencies: [:dir, :dependency_name, :target_version, :lockfile_name, :using_bundler2, :credentials]
|
24
21
|
}.each do |function, kwargs|
|
25
22
|
describe "::#{function}" do
|
@@ -5,8 +5,7 @@ require "webmock/rspec"
|
|
5
5
|
require "byebug"
|
6
6
|
|
7
7
|
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
|
8
|
-
|
9
|
-
$LOAD_PATH.unshift(File.expand_path("../../v1/monkey_patches", __dir__))
|
8
|
+
$LOAD_PATH.unshift(File.expand_path("../monkey_patches", __dir__))
|
10
9
|
|
11
10
|
# Bundler monkey patches
|
12
11
|
require "definition_ruby_version_patch"
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "tmpdir"
|
4
|
+
require "bundler/compact_index_client"
|
5
|
+
require "bundler/compact_index_client/updater"
|
6
|
+
|
7
|
+
TMP_DIR_PATH = File.expand_path("../tmp", __dir__)
|
8
|
+
|
9
|
+
RSpec.shared_context "in a temporary bundler directory" do
|
10
|
+
let(:project_name) { "gemfile" }
|
11
|
+
|
12
|
+
let(:tmp_path) do
|
13
|
+
Dir.mkdir(TMP_DIR_PATH) unless Dir.exist?(TMP_DIR_PATH)
|
14
|
+
dir = Dir.mktmpdir("native_helper_spec_", TMP_DIR_PATH)
|
15
|
+
Pathname.new(dir).expand_path
|
16
|
+
end
|
17
|
+
|
18
|
+
before do
|
19
|
+
project_dependency_files(project_name).each do |file|
|
20
|
+
File.write(File.join(tmp_path, file[:name]), file[:content])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def in_tmp_folder(&block)
|
25
|
+
Dir.chdir(tmp_path, &block)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
RSpec.shared_context "without caching rubygems" do
|
30
|
+
before do
|
31
|
+
# Stub Bundler to stop it using a cached versions of Rubygems
|
32
|
+
allow_any_instance_of(Bundler::CompactIndexClient::Updater).
|
33
|
+
to receive(:etag_for).and_return("")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
RSpec.shared_context "stub rubygems compact index" do
|
38
|
+
include_context "without caching rubygems"
|
39
|
+
|
40
|
+
before do
|
41
|
+
# Stub the Rubygems index
|
42
|
+
stub_request(:get, "https://index.rubygems.org/versions").
|
43
|
+
to_return(
|
44
|
+
status: 200,
|
45
|
+
body: fixture("ruby", "rubygems_responses", "index")
|
46
|
+
)
|
47
|
+
|
48
|
+
# Stub the Rubygems response for each dependency we have a fixture for
|
49
|
+
fixtures =
|
50
|
+
Dir[File.join("../../spec", "fixtures", "ruby", "rubygems_responses", "info-*")]
|
51
|
+
fixtures.each do |path|
|
52
|
+
dep_name = path.split("/").last.gsub("info-", "")
|
53
|
+
stub_request(:get, "https://index.rubygems.org/info/#{dep_name}").
|
54
|
+
to_return(
|
55
|
+
status: 200,
|
56
|
+
body: fixture("ruby", "rubygems_responses", "info-#{dep_name}")
|
57
|
+
)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.138.
|
4
|
+
version: 0.138.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.138.
|
19
|
+
version: 0.138.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.138.
|
26
|
+
version: 0.138.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,14 +206,19 @@ files:
|
|
206
206
|
- helpers/v1/spec/functions/version_resolver_spec.rb
|
207
207
|
- helpers/v1/spec/native_spec_helper.rb
|
208
208
|
- helpers/v1/spec/shared_contexts.rb
|
209
|
-
- helpers/v2/.bundle/config
|
210
209
|
- helpers/v2/.gitignore
|
211
210
|
- helpers/v2/Gemfile
|
212
211
|
- helpers/v2/build
|
213
212
|
- helpers/v2/lib/functions.rb
|
213
|
+
- helpers/v2/lib/functions/file_parser.rb
|
214
|
+
- helpers/v2/monkey_patches/definition_bundler_version_patch.rb
|
215
|
+
- helpers/v2/monkey_patches/definition_ruby_version_patch.rb
|
216
|
+
- helpers/v2/monkey_patches/git_source_patch.rb
|
214
217
|
- helpers/v2/run.rb
|
218
|
+
- helpers/v2/spec/functions/file_parser_spec.rb
|
215
219
|
- helpers/v2/spec/functions_spec.rb
|
216
220
|
- helpers/v2/spec/native_spec_helper.rb
|
221
|
+
- helpers/v2/spec/shared_contexts.rb
|
217
222
|
- lib/dependabot/bundler.rb
|
218
223
|
- lib/dependabot/bundler/file_fetcher.rb
|
219
224
|
- lib/dependabot/bundler/file_fetcher/child_gemfile_finder.rb
|
data/helpers/v2/.bundle/config
DELETED