1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/date] Expose Date::VERSION

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.

https://github.com/ruby/date/commit/fef7ec18d8
This commit is contained in:
Jean Boussier 2021-11-16 14:14:28 +01:00 committed by Hiroshi SHIBATA
parent 2efbb35a8f
commit 3ce27552df
2 changed files with 7 additions and 1 deletions

View file

@ -1,7 +1,12 @@
# frozen_string_literal: true
version = File.foreach(File.expand_path("../lib/date.rb", __FILE__)).find do |line|
/^\s*VERSION\s*=\s*["'](.*)["']/ =~ line and break $1
end
Gem::Specification.new do |s|
s.name = "date"
s.version = '3.2.1'
s.version = version
s.summary = "A subclass of Object includes Comparable module for handling dates."
s.description = "A subclass of Object includes Comparable module for handling dates."

View file

@ -4,6 +4,7 @@
require 'date_core'
class Date
VERSION = '3.2.1' # :nodoc:
def infinite?
false