How do I add conditional rubygem requirements to a gem specification?

后端 未结 7 671
伪装坚强ぢ
伪装坚强ぢ 2021-01-06 03:00

Is it possible to add a gem dependency only if the person is using a certain version of ruby?

Background: I\'m working on a fork of a project that u

相关标签:
7条回答
  • 2021-01-06 03:42

    You can't. You need to build two gems, one with

    spec.required_ruby_version = '~> 1.8.6'
    

    and one with

    spec.required_ruby_version = '~> 1.9.1'
    spec.add_dependency 'test-unit', '~> 2.0.5'
    
    0 讨论(0)
提交回复
热议问题