summaryrefslogtreecommitdiff
path: root/ext/json/json.gemspec
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-05 11:23:24 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-05 12:04:11 +0900
commitbf5368493b74d514328f0f1096f760fca1d0c56c (patch)
tree28cb15559d0c18db19ac69df723deec9d408cfd6 /ext/json/json.gemspec
parent84654bfbba8df0f9eb6876051f8fe62f9a423bdd (diff)
[flori/json] Detect json version from version.rb
https://github.com/flori/json/commit/3ef57b5b39
Diffstat (limited to 'ext/json/json.gemspec')
-rw-r--r--ext/json/json.gemspec6
1 files changed, 5 insertions, 1 deletions
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."