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

后端 未结 7 808
伪装坚强ぢ
伪装坚强ぢ 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'
    

提交回复
热议问题