Class: Appraisal::GemManager::BundlerAdapter

Inherits:
Base
  • Object
show all
Defined in:
lib/appraisal/gem_manager/bundler_adapter.rb

Overview

Bundler adapter for gem management operations. This is the default gem manager and is always available.

Constant Summary collapse

DEFAULT_INSTALL_OPTIONS =
{"jobs" => 1}.freeze

Instance Attribute Summary

Attributes inherited from Base

#gemfile_path, #project_root

Instance Method Summary collapse

Methods inherited from Base

#initialize, #validate_availability!

Constructor Details

This class inherits a constructor from Appraisal::GemManager::Base

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/appraisal/gem_manager/bundler_adapter.rb', line 18

def available?
  true # Bundler is always available (it's a dependency of appraisal2)
end

#install(options = {}) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/appraisal/gem_manager/bundler_adapter.rb', line 22

def install(options = {})
  commands = [install_command(options).join(" ")]

  # Only run check command if not using --without option
  if options["without"].nil? || options["without"].empty?
    commands.unshift(check_command.join(" "))
  end

  command = commands.join(" || ")
  command = path_config_command(options["path"], command) if options["path"]
  env = install_environment(options)
  command_options = {:gemfile => gemfile_path}
  command_options[:env] = env unless env.empty?

  Command.new(command, command_options).run
end

#nameObject



14
15
16
# File 'lib/appraisal/gem_manager/bundler_adapter.rb', line 14

def name
  "bundler"
end

#update(gems = []) ⇒ Object



39
40
41
# File 'lib/appraisal/gem_manager/bundler_adapter.rb', line 39

def update(gems = [])
  Command.new(update_command(gems), :gemfile => gemfile_path).run
end