From 91c74f48f1caf1db65554b7e8af722f2686ee9a0 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 24 Apr 2010 10:11:12 -0700 Subject: [PATCH] Bundle.load and Bundle.runtime are the same thing again. --- lib/bundler.rb | 6 +----- lib/bundler/cli.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/bundler.rb b/lib/bundler.rb index 6daa2813132..5651def20d7 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -91,11 +91,7 @@ def require(*groups) end def load - @load ||= runtime - end - - def runtime - @runtime ||= Runtime.new(root, definition) + @load ||= Runtime.new(root, definition) end def definition diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index e99ce54f18f..bffa7a1b97f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -44,7 +44,7 @@ def initialize(*) desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems" def check - env = Bundler.runtime + env = Bundler.load # Check top level dependencies missing = env.dependencies.select { |d| env.index.search(d).empty? } if missing.any? @@ -101,7 +101,7 @@ def lock remove_lockfiles end - Bundler.runtime.lock + Bundler.load.lock Bundler.ui.confirm("Your bundle is now locked. " + "Use `bundle show [gemname]` to list the gems in the environment.") rescue GemNotFound, VersionConflict => e @@ -126,7 +126,7 @@ def show(gem_name = nil) Bundler.ui.info locate_gem(gem_name) else Bundler.ui.info "Gems included by the bundle:" - Bundler.runtime.specs.sort_by { |s| s.name }.each do |s| + Bundler.load.specs.sort_by { |s| s.name }.each do |s| Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})" end end @@ -136,8 +136,8 @@ def show(gem_name = nil) desc "cache", "Cache all the gems to vendor/cache" method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." def cache - Bundler.runtime.cache - Bundler.runtime.prune_cache unless options[:no_prune] + Bundler.load.cache + Bundler.load.prune_cache unless options[:no_prune] rescue GemNotFound => e Bundler.ui.error(e.message) Bundler.ui.warn "Run `bundle install` to install missing gems." @@ -223,7 +223,7 @@ def remove_lockfiles end def locate_gem(name) - spec = Bundler.runtime.specs.find{|s| s.name == name } + spec = Bundler.load.specs.find{|s| s.name == name } raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec spec.full_gem_path end