sam-github / vpim

vCard and iCalendar support for ruby
http://vpim.rubyforge.org/
Other
142 stars 69 forks source link

make gemspec usable via bundler git dependency #9

Closed grosser closed 10 years ago

grosser commented 11 years ago
gem "vpim",                 :git => "https://github.com/sam-github/vpim.git"

this does not work, would be nice to try out the new changes, otherwise please release a new version I'd like to try it.

Also the sourcecode url is missing from rubygems.org/gems/vpim, would make it easier to find the repo

@sam-github

henrycatalinismith commented 11 years ago

This appears to be caused by the fact that vpim.gemspec contains more than just the specification for the vpim gem. Presumably bundler must be expecting that the ruby code in the Gemfile will return the specification for the gem being installed. This is what the error message looks like when you try to install via git.

source "https://rubygems.org"
gem "vpim", :github => "sam-github/vpim"

$ bundle install
Fetching git://github.com/sam-github/vpim.git
remote: Counting objects: 2065, done.
remote: Compressing objects: 100% (1011/1011), done.
remote: Total 2065 (delta 1079), reused 1969 (delta 992)
Receiving objects: 100% (2065/2065), 7.94 MiB | 724 KiB/s, done.
Resolving deltas: 100% (1079/1079), done.
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Could not find gem 'vpim (>= 0) ruby' in git://github.com/sam-github/vpim.git (at master).
Source does not contain any versions of 'vpim (>= 0) ruby'

To confirm this, I created a version of vpim.gemspec that does return the vpim gem metadata, and it seems to work fine.

source "https://rubygems.org"
gem "vpim", :github => "h2s/vpim", :branch => "gemfile"

$ bundle install
Fetching git://github.com/h2s/vpim.git
remote: Counting objects: 2068, done.
remote: Compressing objects: 100% (1014/1014), done.
remote: Total 2068 (delta 1081), reused 1970 (delta 992)
Receiving objects: 100% (2068/2068), 7.94 MiB | 682 KiB/s, done.
Resolving deltas: 100% (1081/1081), done.
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using vpim (13.10.4) from git://github.com/h2s/vpim.git (at gemfile) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

So the way to achieve this is probably to evict spec_vpim_icalendar into its own vpim_icalendar.gemspec file. That sound okay to you Sam?

henrycatalinismith commented 11 years ago

As for the source code link on rubygems.org, it looks like the owner of the gem has to add this manually at https://rubygems.org/gems/vpim/edit. I was surprised to learn that this isn't something you can specify in the gemspec.