Class: Bootboot::Command

Inherits:
Bundler::Plugin::API
  • Object
show all
Defined in:
lib/bootboot/command.rb

Instance Method Summary collapse

Instance Method Details

#exec(_cmd, _args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bootboot/command.rb', line 11

def exec(_cmd, _args)
  FileUtils.cp(GEMFILE_LOCK, GEMFILE_NEXT_LOCK)

  File.open(GEMFILE, "a+") do |f|
    f.write(<<~EOM)
      Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')

      if ENV['#{Bootboot.env_next}']
        enable_dual_booting if Plugin.installed?('bootboot')

        # Add any gem you want here, they will be loaded only when running
        # bundler command prefixed with `#{Bootboot.env_next}=1`.
      end
    EOM
  end
end

#setupObject



7
8
9
# File 'lib/bootboot/command.rb', line 7

def setup
  self.class.command("bootboot")
end