bootboot 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/bootboot/bundler_patch.rb +11 -9
- data/lib/bootboot/ruby_source.rb +24 -9
- data/lib/bootboot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9d43952cbfd83694c174233e724fadcd4003f1ddaf8a33b79089782334cb74f
|
4
|
+
data.tar.gz: c569400d898e2d7ed519579d595c3ea79e0cc96e13300e3176c28728af49b001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00ed13d606f63cc3eed624aab9dd314b33e9b227716524c2f891ac7089acc6d6ae50e5ba68f7644af94246eaf58da7c373e76dfdc05b603d092685a9450ae746
|
7
|
+
data.tar.gz: 99bd2435970d06ea198ca27e53be25d438cb1a633cc2df6a76f551be94b8f5fc893400774b5b98d2497e3843399a708f65665230178afde35bf3f0475b61bc5c
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## 👢👢 Bootboot - [![Build Status](https://
|
1
|
+
## 👢👢 Bootboot - [![Build Status](https://github.com/Shopify/bootboot/actions/workflows/ci.yml/badge.svg)](https://github.com/Shopify/bootboot/actions/workflows/ci.yml)
|
2
2
|
|
3
3
|
Introduction
|
4
4
|
------------
|
@@ -44,7 +44,7 @@ Installation
|
|
44
44
|
------------
|
45
45
|
1) In your Gemfile, add this
|
46
46
|
```ruby
|
47
|
-
plugin 'bootboot', '~> 0.
|
47
|
+
plugin 'bootboot', '~> 0.2.1'
|
48
48
|
```
|
49
49
|
2) Run `bundle install && bundle bootboot`
|
50
50
|
3) You're done. Commit the Gemfile and the Gemfile_next.lock
|
@@ -16,15 +16,17 @@ end
|
|
16
16
|
|
17
17
|
module RubyVersionPatch
|
18
18
|
def system
|
19
|
-
if
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
# Only monkey-patch if we're updating the alternate file
|
20
|
+
return super unless ENV["BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE"]
|
21
|
+
|
22
|
+
# Bail out if the Gemfile doesn't specify a Ruby requirement
|
23
|
+
requested_ruby = Bundler::Definition.build(Bootboot::GEMFILE, nil, false).ruby_version
|
24
|
+
return super unless requested_ruby
|
25
|
+
|
26
|
+
# If the requirement is for an exact Ruby version, we should substitute the
|
27
|
+
# system version with the requirement so that it gets written to the lock file
|
28
|
+
requirement = Gem::Requirement.new(requested_ruby.versions)
|
29
|
+
requirement.exact? ? requested_ruby : super
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
data/lib/bootboot/ruby_source.rb
CHANGED
@@ -18,15 +18,30 @@ module Bootboot
|
|
18
18
|
|
19
19
|
def specs
|
20
20
|
Bundler::Index.build do |idx|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
# during dependency resolution so that we can pretend
|
26
|
-
# version is present, as well as when updating the
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
requested_ruby = Bundler::Definition.build(Bootboot::GEMFILE, nil, false).ruby_version
|
22
|
+
system_version = Bundler::RubyVersion.system.gem_version
|
23
|
+
requirement = Gem::Requirement.new(requested_ruby.versions) if requested_ruby
|
24
|
+
|
25
|
+
# This will be used both during dependency resolution so that we can pretend
|
26
|
+
# the intended Ruby version is present, as well as when updating the lock file.
|
27
|
+
ruby_spec_version = if requested_ruby.nil?
|
28
|
+
# if the Gemfile doesn't request a specific Ruby version, just use system
|
29
|
+
system_version
|
30
|
+
elsif !requirement.exact? && requirement.satisfied_by?(system_version)
|
31
|
+
# if the Gemfile requests a non-exact Ruby version which is satisfied by
|
32
|
+
# the currently running Ruby, use that when updating the lock file
|
33
|
+
system_version
|
34
|
+
else
|
35
|
+
# If we're here, there's either an exact requirement for the Ruby version
|
36
|
+
# (in which case we should substitue it instead of current Ruby version),
|
37
|
+
# else the currently running Ruby doesn't satisfy the non-exact requirement
|
38
|
+
# (in which case an error will be thrown by bundler). Not sure how we can
|
39
|
+
# improve the error message, which will be vague due to using #gem_version
|
40
|
+
# of the unsatisified requirement.
|
41
|
+
requested_ruby.gem_version
|
42
|
+
end
|
43
|
+
|
44
|
+
ruby_spec = Gem::Specification.new(ruby_spec_name, ruby_spec_version)
|
30
45
|
ruby_spec.source = self
|
31
46
|
idx << ruby_spec
|
32
47
|
end
|
data/lib/bootboot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootboot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
85
|
+
rubygems_version: 3.3.3
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Dualbooting your ruby app made easy.
|