summaryrefslogtreecommitdiff
path: root/ext/digest/digest.gemspec
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/digest.gemspec')
-rw-r--r--ext/digest/digest.gemspec45
1 files changed, 23 insertions, 22 deletions
diff --git a/ext/digest/digest.gemspec b/ext/digest/digest.gemspec
index 8665e42e0f..4a01c5fde1 100644
--- a/ext/digest/digest.gemspec
+++ b/ext/digest/digest.gemspec
@@ -2,8 +2,13 @@
# frozen_string_literal: true
Gem::Specification.new do |spec|
+ version_module = Module.new do
+ version_rb = File.join(__dir__, "lib/digest/version.rb")
+ module_eval(File.read(version_rb), version_rb)
+ end
+
spec.name = "digest"
- spec.version = "3.0.1.pre"
+ spec.version = version_module::Digest::VERSION
spec.authors = ["Akinori MUSHA"]
spec.email = ["knu@idaemons.org"]
@@ -12,32 +17,28 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/ruby/digest"
spec.licenses = ["Ruby", "BSD-2-Clause"]
- spec.files = [
- "LICENSE.txt", "README.md",
- "ext/digest/bubblebabble/bubblebabble.c", "ext/digest/bubblebabble/extconf.rb", "ext/digest/defs.h",
- "ext/digest/digest.c", "ext/digest/digest.h", "ext/digest/digest_conf.rb", "ext/digest/extconf.rb",
- "ext/digest/md5/extconf.rb", "ext/digest/md5/md5.c", "ext/digest/md5/md5.h", "ext/digest/md5/md5cc.h",
- "ext/digest/md5/md5init.c", "ext/digest/rmd160/extconf.rb", "ext/digest/rmd160/rmd160.c",
- "ext/digest/rmd160/rmd160.h", "ext/digest/rmd160/rmd160init.c", "ext/digest/sha1/extconf.rb",
- "ext/digest/sha1/sha1.c", "ext/digest/sha1/sha1.h", "ext/digest/sha1/sha1cc.h",
- "ext/digest/sha1/sha1init.c", "ext/digest/sha2/extconf.rb", "ext/digest/sha2/lib/sha2.rb",
- "ext/digest/sha2/sha2.c", "ext/digest/sha2/sha2.h", "ext/digest/sha2/sha2cc.h",
- "ext/digest/sha2/sha2init.c", "ext/digest/test.sh", "ext/openssl/deprecation.rb",
- "lib/digest.rb"
+ spec.files = [
+ "LICENSE.txt",
+ "README.md",
+ *Dir["lib/digest{.rb,/**/*.rb}"],
]
spec.required_ruby_version = ">= 2.5.0"
spec.bindir = "exe"
spec.executables = []
- spec.require_paths = ["lib"]
- spec.extensions = %w[
- ext/digest/extconf.rb
- ext/digest/bubblebabble/extconf.rb
- ext/digest/md5/extconf.rb
- ext/digest/rmd160/extconf.rb
- ext/digest/sha1/extconf.rb
- ext/digest/sha2/extconf.rb
- ]
+
+ if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby'
+ spec.platform = 'java'
+
+ spec.files += Dir["ext/java/**/*.{rb,java}", "lib/digest.jar"]
+ spec.require_paths = %w[lib ext/java/org/jruby/ext/digest/lib]
+ else
+ spec.extensions = Dir["ext/digest/**/extconf.rb"]
+
+ spec.files += Dir["ext/digest/**/{*.{rb,c,h,sh},depend}"]
+ spec.require_paths = %w[lib]
+ end
+
spec.metadata["msys2_mingw_dependencies"] = "openssl"
end