Permalink
Browse files

Fix the lock stuff

  • Loading branch information...
1 parent ee0e2c1 commit 4317f3c29f7367d653afe7a81e157489f9be72aa Carl Lerche committed Jan 22, 2010
Showing with 21 additions and 7 deletions.
  1. +2 −1 lib/bubble.rb
  2. +3 −0 lib/bubble/environment.rb
  3. +16 −6 spec/lock/gems_spec.rb
View
@@ -31,7 +31,8 @@ def self.load(gemfile = default_gemfile)
end
def self.definition(gemfile = default_gemfile)
- lockfile = Pathname.new(gemfile || default_gemfile).dirname.join('omg.yml')
+ root = Pathname.new(gemfile).dirname
+ lockfile = root.join("vendor/lock.yml")
if lockfile.exist?
Definition.from_lock(lockfile)
else
@@ -56,10 +56,13 @@ def load_paths
def cripple_rubygems
# handle 1.9 where system gems are always on the load path
if defined?(::Gem)
+ me = File.expand_path("../../", __FILE__)
$LOAD_PATH.reject! do |p|
p != File.dirname(__FILE__) &&
Gem.path.any? { |gp| p.include?(gp) }
end
+ $LOAD_PATH.unshift me
+ $LOAD_PATH.uniq!
end
# Disable rubygems' gem activation system
View
@@ -3,17 +3,15 @@
describe "bbl lock with gems" do
before :each do
in_app_root
- end
-
- it "locks the gemfile resolve to the versions available at the time" do
+ system_gems "rack-0.9.1"
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
G
+ end
- system_gems "rack-0.9.1" do
- bbl :lock
- end
+ it "locks the gemfile resolve to the versions available at the time" do
+ bbl :lock
system_gems "rack-1.0.0", "rack-0.9.1" do
should_be_available "rack 0.9.1"
@@ -23,4 +21,16 @@
it "includes the ruby version as a dependency of the lock" do
pending
end
+
+ it "creates a lock.yml file in ./vendor" do
+ bundled_app("vendor/lock.yml").should_not exist
+ bbl :lock
+ bundled_app("vendor/lock.yml").should exist
+ end
+
+ it "creates an environment.rb file in ./vendor" do
+ bundled_app("vendor/environment.rb").should_not exist
+ bbl :lock
+ bundled_app("vendor/lock.yml").should exist
+ end
end

0 comments on commit 4317f3c

Please sign in to comment.