bootboot 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootboot/bundler_patch.rb +3 -3
- data/lib/bootboot/command.rb +11 -11
- data/lib/bootboot/gemfile_next_auto_sync.rb +7 -7
- data/lib/bootboot/ruby_source.rb +1 -1
- data/lib/bootboot/version.rb +1 -1
- data/lib/bootboot.rb +5 -5
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14236a9169a7dea04af00afeb9f53f20cd53e70d969944f12824ba98f76e525a
|
4
|
+
data.tar.gz: 9a31116c9844389ef5a40e234c15a6cdbfaaf031ed67ceaf47856dd2c3496fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: add7b5ca8aa44d3bed18fdcc09b61cf12cc02174a9b2dc947393e22592b0ffa6bea5c4409a8f70564f7d4b501c2233e65a6a292a24c549c915fdd817d46a65f9
|
7
|
+
data.tar.gz: 1114c2d69483098dab6180f7b7ed9b59aea471386c95be1df06ed38f242a021ee2fcf5a21181ebe6eb35a3b73e5b90cedbec26198d20716d4c1a3ee5b3861b0e
|
@@ -4,7 +4,7 @@ require "bootboot/ruby_source"
|
|
4
4
|
|
5
5
|
module DefinitionPatch
|
6
6
|
def initialize(wrong_lock, *args)
|
7
|
-
lockfile = if ENV[
|
7
|
+
lockfile = if ENV["BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE"]
|
8
8
|
wrong_lock
|
9
9
|
else
|
10
10
|
Bootboot::GEMFILE_NEXT_LOCK
|
@@ -16,7 +16,7 @@ end
|
|
16
16
|
|
17
17
|
module RubyVersionPatch
|
18
18
|
def system
|
19
|
-
if ENV[
|
19
|
+
if ENV["BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE"]
|
20
20
|
# If we're updating the alternate file and the ruby version specified in
|
21
21
|
# the Gemfile is different from the Ruby version currently running, we
|
22
22
|
# want to write the version specified in `Gemfile` for the current
|
@@ -54,7 +54,7 @@ Bundler::Dsl.class_eval do
|
|
54
54
|
Bundler::SharedHelpers.singleton_class.prepend(SharedHelpersPatch)
|
55
55
|
Bundler::Settings.prepend(Module.new do
|
56
56
|
def app_cache_path
|
57
|
-
|
57
|
+
"vendor/cache-next"
|
58
58
|
end
|
59
59
|
end)
|
60
60
|
end
|
data/lib/bootboot/command.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "fileutils"
|
4
4
|
|
5
5
|
module Bootboot
|
6
6
|
class Command < Bundler::Plugin::API
|
7
7
|
def setup
|
8
|
-
self.class.command(
|
8
|
+
self.class.command("bootboot")
|
9
9
|
end
|
10
10
|
|
11
11
|
def exec(_cmd, _args)
|
12
12
|
FileUtils.cp(GEMFILE_LOCK, GEMFILE_NEXT_LOCK)
|
13
13
|
|
14
|
-
File.open(GEMFILE,
|
15
|
-
f.write(
|
16
|
-
Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')
|
14
|
+
File.open(GEMFILE, "a+") do |f|
|
15
|
+
f.write(<<~EOM)
|
16
|
+
Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')
|
17
17
|
|
18
|
-
if ENV['#{Bootboot.env_next}']
|
19
|
-
|
18
|
+
if ENV['#{Bootboot.env_next}']
|
19
|
+
enable_dual_booting if Plugin.installed?('bootboot')
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
EOM
|
21
|
+
# Add any gem you want here, they will be loaded only when running
|
22
|
+
# bundler command prefixed with `#{Bootboot.env_next}=1`.
|
23
|
+
end
|
24
|
+
EOM
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -23,7 +23,7 @@ module Bootboot
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def opt_in
|
26
|
-
self.class.hook(
|
26
|
+
self.class.hook("before-install-all") do
|
27
27
|
@previous_lock = Bundler.default_lockfile.read
|
28
28
|
end
|
29
29
|
|
@@ -31,9 +31,9 @@ module Bootboot
|
|
31
31
|
current_definition = Bundler.definition
|
32
32
|
|
33
33
|
next if !GEMFILE_NEXT_LOCK.exist? ||
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
nothing_changed?(current_definition) ||
|
35
|
+
ENV[Bootboot.env_next] ||
|
36
|
+
ENV[Bootboot.env_previous]
|
37
37
|
|
38
38
|
update!(current_definition)
|
39
39
|
end
|
@@ -48,8 +48,8 @@ module Bootboot
|
|
48
48
|
lock = which_lock
|
49
49
|
|
50
50
|
Bundler.ui.confirm("Updating the #{lock}")
|
51
|
-
ENV[env] =
|
52
|
-
ENV[
|
51
|
+
ENV[env] = "1"
|
52
|
+
ENV["BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE"] = "1"
|
53
53
|
|
54
54
|
unlock = current_definition.instance_variable_get(:@unlock)
|
55
55
|
definition = Bundler::Definition.build(GEMFILE, lock, unlock)
|
@@ -57,7 +57,7 @@ module Bootboot
|
|
57
57
|
definition.lock(lock)
|
58
58
|
ensure
|
59
59
|
ENV.delete(env)
|
60
|
-
ENV.delete(
|
60
|
+
ENV.delete("BOOTBOOT_UPDATING_ALTERNATE_LOCKFILE")
|
61
61
|
end
|
62
62
|
|
63
63
|
def which_env
|
data/lib/bootboot/ruby_source.rb
CHANGED
@@ -26,7 +26,7 @@ module Bootboot
|
|
26
26
|
# version is present, as well as when updating the lockfile itself.
|
27
27
|
ruby_version = Bundler::Definition.build(Bootboot::GEMFILE, nil, false).ruby_version
|
28
28
|
ruby_version ||= Bundler::RubyVersion.system
|
29
|
-
ruby_spec = Gem::Specification.new(ruby_spec_name, ruby_version.
|
29
|
+
ruby_spec = Gem::Specification.new(ruby_spec_name, ruby_version.gem_version)
|
30
30
|
ruby_spec.source = self
|
31
31
|
idx << ruby_spec
|
32
32
|
end
|
data/lib/bootboot/version.rb
CHANGED
data/lib/bootboot.rb
CHANGED
@@ -8,22 +8,22 @@ module Bootboot
|
|
8
8
|
GEMFILE_LOCK = Pathname("#{GEMFILE}.lock")
|
9
9
|
GEMFILE_NEXT_LOCK = Pathname("#{GEMFILE}_next.lock")
|
10
10
|
|
11
|
-
autoload :GemfileNextAutoSync,
|
12
|
-
autoload :Command,
|
11
|
+
autoload :GemfileNextAutoSync, "bootboot/gemfile_next_auto_sync"
|
12
|
+
autoload :Command, "bootboot/command"
|
13
13
|
|
14
14
|
class << self
|
15
15
|
def env_next
|
16
|
-
env_prefix +
|
16
|
+
env_prefix + "_NEXT"
|
17
17
|
end
|
18
18
|
|
19
19
|
def env_previous
|
20
|
-
env_prefix +
|
20
|
+
env_prefix + "_PREVIOUS"
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def env_prefix
|
26
|
-
Bundler.settings[
|
26
|
+
Bundler.settings["bootboot_env_prefix"] || "DEPENDENCIES"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
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.1
|
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: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :development
|
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: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10.0'
|
41
41
|
description: " This gem remove the overhead of monkeypatching your Gemfile in order
|
42
42
|
to dualboot your app using the Gemfile_next lock strategy It also ensure that dependencies
|
43
43
|
in the Gemfile lock and Gemfile_next lock are in sync whenever someone updates a
|
@@ -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.2.20
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Dualbooting your ruby app made easy.
|