Reputation: 2535
I am making changes to my ruby gem to make it asset pipeline compatible. In my gemspec I want to say that it requires rails version > 3.1
and < 4
. How do I do that.
currently this is what I have.
s.add_dependency("rails", ">= 3.1")
But this is not ideal. This is saying that it will also work with rails 4.0
which might not be true.
Upvotes: 6
Views: 2870
Reputation: 6516
You can use the pessimistic operator ~>
Using the pessimistic operator, you could write
s.add_dependency("rails", "~> 3.1")
which is equivalent to '>= 3.1', '< 4.0'
Upvotes: 12