dependabot-bundler 0.243.0 → 0.244.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 207f63c298a78b280ccc9b3fe1532398d835b63e9d07d03ca102b23ed69665ac
4
- data.tar.gz: 2500aff804725bc44dbec2033c047c00ffb71dfcbf9ae0c87b5672dc7d0a4e41
3
+ metadata.gz: dc9561c2cec6477046f92d8c3539d69cfecdeeaff241a8c24a1bc6f76078741c
4
+ data.tar.gz: 401f077235d49135e00694bb549a9163222c54415541d954606b912389909c59
5
5
  SHA512:
6
- metadata.gz: 5b3ab8a5707a3bb5aa5ccc41e3e307dbfcf48e304f8b248b588502dc6a779101270d94c9e29918f24317230bb729033e97be7644450d0cdc5135b96048afed37
7
- data.tar.gz: a74c2b9829c26159b8a16818ada22088bc75de98e597dbcfb34cb07b91236f4721c03842c679bf32e1975dfb499b11cc7333fe3dbed6a6e9498b88290ef65b1b
6
+ metadata.gz: d2803abd9773bac2f56677927245d8552aa60be2c06203f94685cf765d8e563f0774ae9f3bc7ddac99b4d038ee3f096c21d9a69ba128926b6c316e952042b485
7
+ data.tar.gz: 2617cd80e87d7fa73143fa2fc6d569019e0757e69a68bcda25cbd7290d8cad9edaef5d61fb012ffcb244de71eddd50724ae4d70afd875905b35eb2535a8179a2
@@ -6,7 +6,14 @@ require "bundler/definition"
6
6
  module BundlerDefinitionRubyVersionPatch
7
7
  def ruby_version
8
8
  super || begin
9
- Bundler::RubyVersion.from_string(File.read(".ruby-version", chomp: true))
9
+ file_content = Bundler.read_file(".ruby-version")
10
+ ruby_version =
11
+ if /^ruby(-|\s+)([^\s#]+)/ =~ file_content
12
+ ::Regexp.last_match(2)
13
+ else
14
+ file_content.strip
15
+ end
16
+ Bundler::RubyVersion.new(ruby_version, nil, nil, nil) if ruby_version
10
17
  rescue SystemCallError
11
18
  # .ruby-version doesn't exist, fallback to the Ruby Dependabot runs
12
19
  end
@@ -0,0 +1,40 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ require "native_spec_helper"
5
+ require "shared_contexts"
6
+
7
+ RSpec.describe BundlerDefinitionRubyVersionPatch do
8
+ include_context "in a temporary bundler directory"
9
+ include_context "stub rubygems compact index"
10
+
11
+ let(:project_name) { "ruby_version_implied" }
12
+ before do
13
+ @ui = Bundler.ui
14
+ Bundler.ui = Bundler::UI::Silent.new
15
+ end
16
+ after { Bundler.ui = @ui }
17
+
18
+ it "updates to the most recent version" do
19
+ in_tmp_folder do
20
+ File.delete(".ruby-version")
21
+ definition = Bundler::Definition.build("Gemfile", "Gemfile.lock", gems: ["statesman"])
22
+ definition.resolve_remotely!
23
+ specs = definition.resolve["statesman"]
24
+ expect(specs.size).to eq(1)
25
+ spec = specs.first
26
+ expect(spec.version).to eq("7.2.0")
27
+ end
28
+ end
29
+
30
+ it "doesn't update to a version that is not compatible with the Ruby version implied by .ruby-version" do
31
+ in_tmp_folder do
32
+ definition = Bundler::Definition.build("Gemfile", "Gemfile.lock", gems: ["statesman"])
33
+ definition.resolve_remotely!
34
+ specs = definition.resolve["statesman"]
35
+ expect(specs.size).to eq(1)
36
+ spec = specs.first
37
+ expect(spec.version).to eq("2.0.1")
38
+ end
39
+ end
40
+ 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.243.0
4
+ version: 0.244.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-13 00:00:00.000000000 Z
11
+ date: 2024-02-15 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.243.0
19
+ version: 0.244.0
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.243.0
26
+ version: 0.244.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -272,6 +272,7 @@ files:
272
272
  - helpers/v2/spec/functions/version_resolver_spec.rb
273
273
  - helpers/v2/spec/functions_spec.rb
274
274
  - helpers/v2/spec/native_spec_helper.rb
275
+ - helpers/v2/spec/ruby_version_spec.rb
275
276
  - helpers/v2/spec/shared_contexts.rb
276
277
  - lib/dependabot/bundler.rb
277
278
  - lib/dependabot/bundler/file_fetcher.rb
@@ -312,7 +313,7 @@ licenses:
312
313
  - Nonstandard
313
314
  metadata:
314
315
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
315
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.243.0
316
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.244.0
316
317
  post_install_message:
317
318
  rdoc_options: []
318
319
  require_paths: