Skip to content

Commit

Permalink
Bundle.load and Bundle.runtime are the same thing again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Apr 24, 2010
1 parent a4959f6 commit 91c74f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions lib/bundler.rb
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions lib/bundler/cli.rb
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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."
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 91c74f4

Please sign in to comment.