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

Specification gets loaded_from set to a Pathname #25

Closed
darrenboyd opened this issue Feb 5, 2010 · 5 comments
Closed

Specification gets loaded_from set to a Pathname #25

darrenboyd opened this issue Feb 5, 2010 · 5 comments

Comments

@darrenboyd
Copy link

The Specification#loaded_from sometimes returns a String and sometimes returns a Pathname. In Rails 2.3.5 (vendor_gem_source_index.rb:40), we have this code...

spec.loaded_from.empty?

There is no Pathname#empty?, so it looks like the Rails code is expecting a String.

I'm not sure who's to blame here. Maybe the Rails code shouldn't be assuming a String. If that's the case, feel free to reject and I will post an issue to Rails.

@darrenboyd
Copy link
Author

Note that I am seeing Bundler use a Pathname object in the Specification when the gem was declared like this...

gem 'my_vendored_gem', '1.0.0', :path => File.expand_path('../vendor/gems', __FILE__)

otherwise, I am seeing a String.

@eddanger
Copy link

eddanger commented Feb 5, 2010

I'm getting a similar error using Bundler 0.9.2 and Rails 2.3.5

vendor_gem_source_index.rb:40:in refresh!': undefined methodempty?' for #Pathname:0x1005b8988 (NoMethodError)

Using preinitializer: http://gist.github.com/296115

@indirect
Copy link
Member

This should be fixed as of 7a9d6a2.

@will
Copy link
Contributor

will commented Feb 25, 2010

I'm getting the
undefined method `empty?' for #Pathname:0x102441c88
in
% bundle -v
Bundler version 0.9.7

when the bundle is unlocked. When it is locked, it works fine

@indirect
Copy link
Member

Correct. This will be fixed in 0.9.8.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants