1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/zlib] Search zlib.c as a gem

https://github.com/ruby/zlib/commit/8f43b264cd
This commit is contained in:
Nobuyoshi Nakada 2019-09-29 18:21:17 +09:00
parent ce477089f6
commit f10c9cb1f2

View file

@ -1,9 +1,16 @@
# coding: utf-8
# frozen_string_literal: true
source_version = File.open(File.join(__dir__, "zlib.c")) {|f|
f.gets("\n#define RUBY_ZLIB_VERSION ")
f.gets[/\s*(".+")/, 1].undump
}
source_version = ["", "ext/zlib/"].find do |dir|
begin
break File.open(File.join(__dir__, "#{dir}zlib.c")) {|f|
f.gets("\n#define RUBY_ZLIB_VERSION ")
f.gets[/\s*"(.+)"/, 1]
}
rescue Errno::ENOENT
end
end
Gem::Specification.new do |spec|
spec.name = "zlib"
spec.version = source_version