specify dependencies per ruby version #126

Closed
tenderlove opened this Issue Jun 30, 2011 · 8 comments

Comments

Projects
None yet
9 participants
@tenderlove
Contributor

tenderlove commented Jun 30, 2011

Hi,

I think it would be nice if I could specify dependencies depending on the ruby version. For example, the perftools.rb gem has a dependency if it's on 1.9, but does not require that dependency on 1.8.

Thanks.

@jfirebaugh

This comment has been minimized.

Show comment Hide comment
@jfirebaugh

jfirebaugh Aug 22, 2011

Another example: the ruby-debug and ruby-debug-ide gems should depend on ruby-debug-base on 1.8 and ruby-debug-base19 on 1.9. Right now ruby-debug-ide gem has a mkrf_conf.rb hack similar to the perftools.rb example.

Another example: the ruby-debug and ruby-debug-ide gems should depend on ruby-debug-base on 1.8 and ruby-debug-base19 on 1.9. Right now ruby-debug-ide gem has a mkrf_conf.rb hack similar to the perftools.rb example.

@ghost ghost assigned zenspider Sep 1, 2011

@zenspider

This comment has been minimized.

Show comment Hide comment
@zenspider

zenspider Sep 1, 2011

Contributor

I'm not sure how we'd want to do this. I do want to vote for something as simple as possible. I dread the idea of us having a hash-based notation that eventually becomes turing complete. Rather than:

dependency "X", "~> 1.0", :ruby => "< 1.9"
dependency "Y", "~> 1.0", :ruby => ">= 1.9"

I'd much rather see something limited to a known set of capabilities:

dependency "X", "~> 1.0", :ruby18
dependency "Y", "~> 1.0", :ruby19

or

dependency "Z", "~> 1.0", :windows

I think we can figure out a closed set of conditional capabilities and provide that in a clean implementation (:windows, :ruby18, :ruby19 should cover 80+%).

Contributor

zenspider commented Sep 1, 2011

I'm not sure how we'd want to do this. I do want to vote for something as simple as possible. I dread the idea of us having a hash-based notation that eventually becomes turing complete. Rather than:

dependency "X", "~> 1.0", :ruby => "< 1.9"
dependency "Y", "~> 1.0", :ruby => ">= 1.9"

I'd much rather see something limited to a known set of capabilities:

dependency "X", "~> 1.0", :ruby18
dependency "Y", "~> 1.0", :ruby19

or

dependency "Z", "~> 1.0", :windows

I think we can figure out a closed set of conditional capabilities and provide that in a clean implementation (:windows, :ruby18, :ruby19 should cover 80+%).

@jfirebaugh

This comment has been minimized.

Show comment Hide comment
@jfirebaugh

jfirebaugh Sep 1, 2011

Sounds similar to the :platforms option for Gemfiles.

Sounds similar to the :platforms option for Gemfiles.

@erikh

This comment has been minimized.

Show comment Hide comment
@erikh

erikh Sep 2, 2011

Contributor

I had a patch for this that implemented R>= R> etc for Gem::Requirement; I can push it somewhere if you guys want to check it out.

Contributor

erikh commented Sep 2, 2011

I had a patch for this that implemented R>= R> etc for Gem::Requirement; I can push it somewhere if you guys want to check it out.

@troessner

This comment has been minimized.

Show comment Hide comment
@troessner

troessner Apr 25, 2012

Hey guys,

are there any updates on this issue? I would love to see this as well. Any way I can help?

Hey guys,

are there any updates on this issue? I would love to see this as well. Any way I can help?

@stereobooster

This comment has been minimized.

Show comment Hide comment
@stereobooster

stereobooster Jun 25, 2012

Sounds similar to the :platforms option for Gemfiles.

It make sense, that it's not just sound the same, but actually will use the same notation. Because a lot of developers already familiar with it.

This code can be extracted from bundler, and placed in rubygems. Than other gems can use it too. @carlhuda, @indirect what do you think about it?

There are seems to be a lot of similar code which can be extracted
https://github.com/carlhuda/bundler/blob/master/lib/bundler.rb#L64
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/platform.rb#L67
https://github.com/rubygems/rubygems/blob/master/lib/rubygems.rb#L118

Sounds similar to the :platforms option for Gemfiles.

It make sense, that it's not just sound the same, but actually will use the same notation. Because a lot of developers already familiar with it.

This code can be extracted from bundler, and placed in rubygems. Than other gems can use it too. @carlhuda, @indirect what do you think about it?

There are seems to be a lot of similar code which can be extracted
https://github.com/carlhuda/bundler/blob/master/lib/bundler.rb#L64
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/platform.rb#L67
https://github.com/rubygems/rubygems/blob/master/lib/rubygems.rb#L118

@drbrain

This comment has been minimized.

Show comment Hide comment
@drbrain

drbrain Nov 28, 2012

Owner

This feature is looking for an implementer. Without a patch this feature request will eventually be closed ☹ ☹ ☹

Owner

drbrain commented Nov 28, 2012

This feature is looking for an implementer. Without a patch this feature request will eventually be closed ☹ ☹ ☹

nobu pushed a commit to nobu/rubygems that referenced this issue Jan 12, 2014

@copiousfreetime

This comment has been minimized.

Show comment Hide comment
@copiousfreetime

copiousfreetime Jan 18, 2016

Contributor

Although this is a lovely idea, This issue has had no traffic in 3 years. Closing.

Contributor

copiousfreetime commented Jan 18, 2016

Although this is a lovely idea, This issue has had no traffic in 3 years. Closing.

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