Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Start using the new lockfile format when installing

  • Loading branch information...
commit e00a48b5fc049488822657924aa8314a77a7dd6f 1 parent f779dee
Carlhuda authored
View
19 lib/bundler/flex/definition.rb
@@ -2,7 +2,7 @@
module Bundler
module Flex
class Definition
- attr_reader :dependencies, :sources
+ attr_reader :dependencies, :sources, :locked_specs
def self.build(gemfile, lockfile)
gemfile = Pathname.new(gemfile).expand_path
@@ -18,15 +18,28 @@ def self.build(gemfile, lockfile)
end
def initialize(lockfile, dependencies, sources)
- @lockfile, @dependencies, @sources = lockfile, dependencies, sources
+ @dependencies, @sources = dependencies, sources
+
+ if lockfile && File.exists?(lockfile)
+ locked = LockfileParser.new(File.read(lockfile))
+ @locked_specs = locked.specs
+ else
+ @locked_specs = []
+ end
end
- alias resolved_dependencies dependencies
+ # TODO: OMG LOL
+ def resolved_dependencies
+ locked_specs_as_deps + dependencies
+ end
def groups
dependencies.map { |d| d.groups }.flatten.uniq
end
+ def locked_specs_as_deps
+ locked_specs.map { |s| Gem::Dependency.new(s.name, s.version) }
+ end
end
end
end
View
1  lib/bundler/templates/environment.erb
@@ -56,7 +56,6 @@ module Bundler
end
def self.setup(*groups)
- match_fingerprint
clean_load_path
cripple_rubygems(SPECS)
configure_gem_path_and_home(SPECS)
View
4 spec/install/gems/flex_spec.rb
@@ -1,10 +1,6 @@
require "spec_helper"
describe "bundle flex_install" do
- before do
- pending
- end
-
it "installs the gems as expected" do
flex_install_gemfile <<-G
source "file://#{gem_repo1}"
View
2  spec/runtime/environment_rb_spec.rb
@@ -173,6 +173,7 @@ def Bundler.require(path)
end
it "tells you to install if lock is outdated" do
+ pending
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack", "1.0"
@@ -199,6 +200,7 @@ def Bundler.require(path)
end
it "requests regeneration if it's out of sync" do
+ pending
old_env = File.read(env_file)
install_gemfile <<-G, :relock => true
source "file://#{gem_repo1}"
Please sign in to comment.
Something went wrong with that request. Please try again.