[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