def install(options = {})
dependencies = @environment.dependencies
sources = @environment.sources
if only_envs = options[:only]
dependencies.reject! { |d| !only_envs.any? {|env| d.in?(env) } }
end
begin
valid = nil
rescue Bundler::GemNotFound
end
sources = only_local(sources) if options[:cached]
if options[:update] || !valid
Bundler.logger.info "Calculating dependencies..."
bundle = Resolver.resolve(dependencies, [@cache] + sources)
download(bundle, options)
do_install(bundle, options)
valid = bundle
end
generate_bins(valid, options)
cleanup(valid, options)
configure(valid, options)
Bundler.logger.info "Done."
end