summaryrefslogtreecommitdiff
path: root/ext/digest/digest.gemspec
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-11-17 15:08:46 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-11-17 15:08:46 +0900
commitd23b3d9b7dc2964da36dc9daf96718b1867adcae (patch)
tree6f38b5b67c47430be10d8ed2fa67aa60dc9b6766 /ext/digest/digest.gemspec
parent21b8f992de19fd3d7e7dd258f761b47566c3d6cf (diff)
Prevent "already initialized constant Digest::VERSION"
http://rubyci.s3.amazonaws.com/ubuntu1804/ruby-master/log/20211117T033003Z.log.html.gz ``` installing default gems from ext: /home/chkbuild/chkbuild/tmp/build/20211117T033003Z/lib/ruby/gems/3.1.0 /home/chkbuild/chkbuild/tmp/build/20211117T033003Z/ruby/ext/digest/lib/digest/version.rb:4: warning: already initialized constant Digest::VERSION /home/chkbuild/chkbuild/tmp/build/20211117T033003Z/ruby/.ext/common/digest/version.rb:4: warning: previous definition of VERSION was here ``` This hack is copied from ext/psych/psych.gemspec
Diffstat (limited to 'ext/digest/digest.gemspec')
-rw-r--r--ext/digest/digest.gemspec7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/digest/digest.gemspec b/ext/digest/digest.gemspec
index d27d82148c..f8dff1797a 100644
--- a/ext/digest/digest.gemspec
+++ b/ext/digest/digest.gemspec
@@ -1,11 +1,14 @@
# coding: utf-8
# frozen_string_literal: true
-require_relative 'lib/digest/version'
+version_module = Module.new do
+ version_rb = File.join(__dir__, "lib/digest/version.rb")
+ module_eval(File.read(version_rb), version_rb)
+end
Gem::Specification.new do |spec|
spec.name = "digest"
- spec.version = Digest::VERSION
+ spec.version = version_module::Digest::VERSION
spec.authors = ["Akinori MUSHA"]
spec.email = ["knu@idaemons.org"]