diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-30 13:23:44 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-14 01:49:51 +0000 |
commit | 3f8756484f221625bf7069f46bd876bfe3645940 (patch) | |
tree | 92e1bce13ce0cf19d8c40ff00729d7c9aa56365e /lib/pp.gemspec | |
parent | 652f27330851e6154fc027515dcd43954a69cd9a (diff) |
[ruby/pp] Expose PP::VERSION
https://github.com/ruby/pp/commit/3d0e65e79f
Diffstat (limited to 'lib/pp.gemspec')
-rw-r--r-- | lib/pp.gemspec | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/pp.gemspec b/lib/pp.gemspec index 3f08f400c4..27a92a8ce4 100644 --- a/lib/pp.gemspec +++ b/lib/pp.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 = "pp" - spec.version = "0.4.0" + spec.name = name + spec.version = version spec.authors = ["Tanaka Akira"] spec.email = ["akr@fsij.org"] |