wycats / bundler

407 stars 30 forks source link

Behaviour of :path v.s. :git too different? #145

Open KieranP opened 14 years ago

KieranP commented 14 years ago

Consider the follow using the latest bundler release:

gem "rails", :git => 'git://github.com/rails/rails.git'  # Works, bundles sub parts of rails

gem "rails", :path => '/path/to/rails' # Doesn't work, I guess it looks for a .gemspec in root dir and doesn't find one?

The former behaviour is used in Rails when you generate a new app with --edge, the latter behaviour when made with --dev . When you run gem bundle with --dev, it won't find all the parts it should. To me, the only difference between :path and :git should be the location of where it is (local/remote).

Because :path does not take a :glob option (it complains), I've gotten around this by using:

gem "rails", :git => '/path/to/rails'

but it's not ideal (when it's a download for example, not a clone, it complains).

Is this a bug, a feature, or Rails incorrect usage of :path? I noticed in Yehdua's recent blog post that he used 'directory' pointing to the checkout, and with a glob. This worked fine, but it would be nice to get this on one line.

Edit: Clarfing 'failed to find all the gem parts'. Normally when you bundle, it puts all the files and folders of gems it finds into the dirs folder, i.e. rails/activerecord/activerecord.gemspec would be parsed and take all rails/activerecord/lib files or something like that (I'm unfamiliar with the internals, I'm guessing how it operates. You should hopefully get what I mean even if the operation is different).

When it's not working (as is the case with using :path with 'gem'), a rails directory is created, but contains only all gemspec files, none of the actual lib files that are really needed. So it looks like this:

vendor
  gems
    dirs
      rails
        actionpack.gemspec
        activerecord.gemspec
        activesupport.gemspec