[ruby/un] Expose UN::VERSION

https://github.com/ruby/un/commit/47bcad1804
This commit is contained in:
Hiroshi SHIBATA 2023-04-13 18:09:27 +09:00 committed by git
parent de023b68aa
commit 76aaaf6434
2 changed files with 12 additions and 2 deletions

View File

@ -1,8 +1,15 @@
# frozen_string_literal: true
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 = "un"
spec.version = "0.2.1"
spec.name = name
spec.version = version
spec.authors = ["WATANABE Hirofumi"]
spec.email = ["eban@ruby-lang.org"]

View File

@ -412,6 +412,9 @@ def help
end
module UN # :nodoc:
VERSION = "0.2.1"
module_function
def help(argv, output: $stdout)
all = argv.empty?