Skip to content

Commit

Permalink
[ruby/tempfile] Expose Tempfile::VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and matzbot committed Apr 13, 2023
1 parent 84d1149 commit 8b924eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/tempfile.gemspec
@@ -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"]

Expand Down
2 changes: 2 additions & 0 deletions lib/tempfile.rb
Expand Up @@ -88,6 +88,8 @@
# 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.
#
Expand Down

0 comments on commit 8b924eb

Please sign in to comment.