Permalink
Browse files

Clean up bundler.rb a bit, fix spec

  • Loading branch information...
1 parent 354ef91 commit 4c9a157fd36739c5f21ffeeb93068ca968f26ef0 @indirect indirect committed Mar 31, 2010
Showing with 9 additions and 12 deletions.
  1. +7 −11 lib/bundler.rb
  2. +2 −1 spec/runtime/load_spec.rb
View
@@ -65,33 +65,29 @@ def bundle_path
end
def setup(*groups)
- gemfile = default_gemfile
- load(gemfile).setup(*groups)
+ load.setup(*groups)
end
def require(*groups)
- gemfile = default_gemfile
- load(gemfile).require(*groups)
+ load.require(*groups)
end
- def load(gemfile = default_gemfile)
- root = Pathname.new(gemfile).dirname
- Runtime.new root, definition(gemfile)
+ def load
+ Runtime.new root, definition
end
- def definition(gemfile = default_gemfile)
+ def definition
configure
- root = Pathname.new(gemfile).dirname
lockfile = root.join("Gemfile.lock")
if lockfile.exist?
Definition.from_lock(lockfile)
else
- Definition.from_gemfile(gemfile)
+ Definition.from_gemfile(default_gemfile)
end
end
def home
- Pathname.new(bundle_path).join("bundler")
+ bundle_path.join("bundler")
end
def install_path
@@ -34,7 +34,8 @@
it "raises an exception if a specified gemfile is not found" do
lambda {
- Bundler.load("omg.rb")
+ ENV['BUNDLE_GEMFILE'] = "omg.rb"
+ Bundler.load
}.should raise_error(Bundler::GemfileNotFound, /omg\.rb/)
end

0 comments on commit 4c9a157

Please sign in to comment.