Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Fix the lock stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Jan 22, 2010
1 parent ee0e2c1 commit 4317f3c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/bubble.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/bubble/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 16 additions & 6 deletions spec/lock/gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.