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.



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

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/bundler/cli/cache.rb', line 3

def options
  @options
end

Instance Method Details

#runObject



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

def run
  Bundler.definition.validate_ruby!
  Bundler.definition.resolve_with_cache!
  setup_cache_all
  Bundler.settings[:cache_all_platforms] = options["all-platforms"] if options.key?("all-platforms")
  Bundler.load.cache
  Bundler.settings[:no_prune] = true if 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