[ruby/digest] Place common parts in lib and engine specific parts under ext/**/lib

https://github.com/ruby/digest/commit/8d7496c3be
This commit is contained in:
Akinori MUSHA 2021-09-27 16:31:55 +09:00 коммит произвёл Hiroshi SHIBATA
Родитель 5e1d2c5c97
Коммит b245b67d9e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F9CF13417264FAC2
9 изменённых файлов: 20 добавлений и 91 удалений

Просмотреть файл

@ -1,9 +0,0 @@
# frozen_string_literal: false
require 'digest'
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.BubbleBabble")
else
require 'digest/bubblebabble.so'
end

Просмотреть файл

@ -13,59 +13,26 @@ Gem::Specification.new do |spec|
spec.licenses = ["Ruby", "BSD-2-Clause"]
spec.files = [
"LICENSE.txt", "README.md",
"ext/digest/defs.h", "ext/digest/digest.c", "ext/digest/digest.h",
"ext/digest/digest_conf.rb", "ext/digest/extconf.rb",
"ext/digest/lib/digest.rb",
"ext/digest/bubblebabble/bubblebabble.c",
"ext/digest/bubblebabble/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/openssl/deprecation.rb",
"ext/digest/test.sh",
"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"]
if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby'
spec.platform = 'java'
spec.files.concat [
"lib/digest.jar",
"lib/digest/md5.rb",
"lib/digest/sha1.rb",
"lib/digest/sha2.rb",
"lib/digest/rmd160.rb",
"lib/digest/bubblebabble.rb"
]
spec.files += Dir["ext/java/**/*.{rb,java}"]
spec.require_paths = %w[lib ext/java/org/jruby/ext/digest/lib]
else
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
]
spec.extensions = Dir["ext/digest/**/extconf.rb"]
spec.files += Dir["ext/digest/**/*.{rb,c,h,sh}"]
spec.require_paths = %w[lib]
end
spec.metadata["msys2_mingw_dependencies"] = "openssl"

Просмотреть файл

@ -0,0 +1,3 @@
# frozen_string_literal: true
require 'digest.so'

Просмотреть файл

@ -0,0 +1,3 @@
# frozen_string_literal: true
require 'digest/sha2.so'

Просмотреть файл

@ -1,9 +0,0 @@
# frozen_string_literal: false
require 'digest'
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.MD5")
else
require 'digest/md5.so'
end

Просмотреть файл

@ -1,9 +0,0 @@
# frozen_string_literal: false
require 'digest'
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.RMD160")
else
require 'digest/rmd160.so'
end

Просмотреть файл

@ -1,9 +0,0 @@
# frozen_string_literal: false
require 'digest'
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.SHA1")
else
require 'digest/sha1.so'
end

Просмотреть файл

@ -1,9 +1,6 @@
# frozen_string_literal: false
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.DigestLibrary")
else
require 'digest.so'
end
require 'digest/loader'
module Digest
# A mutex for Digest().

Просмотреть файл

@ -11,12 +11,7 @@
# $Id$
require 'digest'
if RUBY_ENGINE == 'jruby'
JRuby::Util.load_ext("org.jruby.ext.digest.SHA2")
else
require 'digest/sha2.so'
end
require 'digest/sha2/loader'
module Digest
#