diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-30 14:09:37 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-13 09:48:55 +0000 |
commit | 84d11498c2198659ae2771dcdad09b1a4a4769d0 (patch) | |
tree | 09e798fb3cfc00207ce59dd5f700b184bfef97e5 /lib/shellwords.gemspec | |
parent | 61bd69470a68354b77fad65119c56cbf19f2c152 (diff) |
[ruby/shellwords] Expose Shellwords::VERSION
https://github.com/ruby/shellwords/commit/e38b8b026a
Diffstat (limited to 'lib/shellwords.gemspec')
-rw-r--r-- | lib/shellwords.gemspec | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/shellwords.gemspec b/lib/shellwords.gemspec index 8ae87b230e..d60ab5f650 100644 --- a/lib/shellwords.gemspec +++ b/lib/shellwords.gemspec @@ -1,6 +1,14 @@ +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 = "shellwords" - spec.version = "0.1.0" + spec.name = name + spec.version = version spec.authors = ["Akinori MUSHA"] spec.email = ["knu@idaemons.org"] |