diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-30 14:08:23 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-25 01:58:12 +0000 |
commit | 15796ae1e80e32e8a4ff25d6663d89afc00025bb (patch) | |
tree | b5f51e76d3457b64648206d7a784c853b2564e3b /lib/set | |
parent | c301ba0a663386881addb1d987cca5e73d35cf2e (diff) | |
download | ruby-15796ae1e80e32e8a4ff25d6663d89afc00025bb.tar.gz |
[ruby/set] Expose Set::VERSION
https://github.com/ruby/set/commit/d39b33f463
Diffstat (limited to 'lib/set')
-rw-r--r-- | lib/set/set.gemspec | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/set/set.gemspec b/lib/set/set.gemspec index 1e83287420..c415fac99c 100644 --- a/lib/set/set.gemspec +++ b/lib/set/set.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 = "set" - spec.version = "1.0.3" + spec.name = name + spec.version = version spec.authors = ["Akinori MUSHA"] spec.email = ["knu@idaemons.org"] |