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)


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

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

#install(options = {}) ⇒ Object



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

def install(options = {})
  env = install_environment(options)
  command_options = {:env => env, :gemfile => gemfile_path}

  if options["path"]
    Command.new(path_config_command(options["path"]), :gemfile => gemfile_path).run
  end

  unless install_options_require_execution?(options)
    check_options = command_options.merge(:allow_failure => true)
    return if Command.new(check_command, check_options).run
  end

  Command.new(install_command(options), command_options).run
end

#name ⇒ Object



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

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