From bf5368493b74d514328f0f1096f760fca1d0c56c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 5 Dec 2023 11:23:24 +0900 Subject: [PATCH] [flori/json] Detect json version from version.rb https://github.com/flori/json/commit/3ef57b5b39 --- ext/json/json.gemspec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/json/json.gemspec b/ext/json/json.gemspec index 9cd4ceee23..33d2140764 100644 --- a/ext/json/json.gemspec +++ b/ext/json/json.gemspec @@ -1,6 +1,10 @@ +version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line| + /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1 +end rescue nil + Gem::Specification.new do |s| s.name = "json" - s.version = File.read(File.expand_path('../VERSION', __FILE__)).chomp + s.version = version s.summary = "JSON Implementation for Ruby" s.description = "This is a JSON implementation as a Ruby extension in C."