Class: Bundler::CLI::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/cli/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Cache

Returns a new instance of Cache.



6
7
8
# File 'lib/bundler/cli/cache.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/bundler/cli/cache.rb', line 5

def options
  @options
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bundler/cli/cache.rb', line 10

def run
  Bundler.definition.validate_runtime!
  Bundler.definition.resolve_with_cache!
  setup_cache_all
  Bundler.settings.set_command_option_if_given :cache_all_platforms, options["all-platforms"]
  Bundler.load.cache
  Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
  Bundler.load.lock
rescue GemNotFound => e
  Bundler.ui.error(e.message)
  Bundler.ui.warn "Run `bundle install` to install missing gems."
  exit 1
end