Conversation
| require 'date_core' | ||
|
|
||
| class Date | ||
| VERSION = '3.2.1' # :nodoc: |
There was a problem hiding this comment.
In the normal pattern it would be defined in lib/date/version.rb and required in the gemspec, but I'm not sure what the consequence could be for something like Date. So I do some parsing instead.
mame
left a comment
There was a problem hiding this comment.
I think it is a good-to-have. AFAIK, adding VERSION to default gems could be tricky because it must work not only on gem repository but also ruby/ruby repository. This change looks reasonable, but I am not familiar, so I ask @hsbt to review.
|
@casperisfine Seems fine. But It's good to separate this detection logic into outside of gemspec block like https://github.com/ruby/net-http/blob/master/net-http.gemspec#L4 Can you update this pull request like net-http.gemspec? Thanks. |
|
Of course. |
An almost universal convention for gems is to expose `Namespace::VERSION` which makes it mcuh easier when debugging etc. Many gems extracted from ruby don't do this, even though it would be even more useful because they ship with ruby, so it's less clear which version it is.
162f5f7 to
fef7ec1
Compare
|
Done. |
|
@casperisfine Thanks! |
An almost universal convention for gems is to expose
Namespace::VERSIONwhich makes it mcuh easier when debugging etc.
Many gems extracted from ruby don't do this, even though it would be even more
useful because they ship with ruby, so it's less clear which version it is.
cc @mame