[ruby/tempfile] Expose Tempfile::VERSION

https://github.com/ruby/tempfile/commit/6aa1f37dc4
This commit is contained in:
Hiroshi SHIBATA 2023-03-30 14:14:15 +09:00 committed by git
parent 84d11498c2
commit 8b924ebdf2
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,13 @@
name = File.basename(__FILE__, ".gemspec")
version = ["lib", Array.new(name.count("-")+1).join("/")].find do |dir|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end
Gem::Specification.new do |spec|
spec.name = "tempfile"
spec.version = "0.1.3"
spec.name = name
spec.version = version
spec.authors = ["Yukihiro Matsumoto"]
spec.email = ["matz@ruby-lang.org"]

View File

@ -88,6 +88,8 @@ require 'tmpdir'
# mutex.
class Tempfile < DelegateClass(File)
VERSION = "0.1.3"
# Creates a file in the underlying file system;
# returns a new \Tempfile object based on that file.
#