Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for the gemspec directive #1

Closed
jasonm opened this Issue Nov 17, 2010 · 3 comments

Comments

Projects
None yet
4 participants

assaf commented Nov 17, 2010

My way of building a Gem is to specify all the runtime dependencies in the .gemspec file, and reference that in Gemfile, adding only development/test dependencies there. For example:
https://github.com/flowtown/rack-oauth2-server/blob/master/Gemfile
https://github.com/flowtown/rack-oauth2-server/blob/master/rack-oauth2-server.gemspec

This just means preserving the gemspec directive when creating the environment-specific Gemfiles.

Contributor

josephholsten commented Jan 10, 2011

Fixed and tested in josephholsten/appraisal@5811c40

Contributor

josephholsten commented Jan 10, 2011

Further thought (dreaming?) has made me realize this isn't a cure-all. The problem is that you want to ship a gem with loose version requirements (s.add_runtime_dependency('factory_girl', '~>1.3.0')), but you want appraisals with tight version requirements like

appraise "1.3.0" do
  gem "factory_girl", "1.3.0"
end
appraise "1.3.2" do
  gem "factory_girl", "1.3.2"
end

But this will just get you an error message like

You cannot specify the same gem twice with different version requirements. You specified: factory_girl (= 1.3.2) and factory_girl (~> 1.3.0)

What's really needed now is support for bundler to select the gem using both constraints. Reported as https://github.com/carlhuda/bundler/issues/issue/930

@sikachu sikachu closed this May 24, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment