[ruby/zlib] Search zlib.c as a gem
https://github.com/ruby/zlib/commit/8f43b264cd
This commit is contained in:
parent
ce477089f6
commit
f10c9cb1f2
@ -1,9 +1,16 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
source_version = File.open(File.join(__dir__, "zlib.c")) {|f|
|
|
||||||
f.gets("\n#define RUBY_ZLIB_VERSION ")
|
source_version = ["", "ext/zlib/"].find do |dir|
|
||||||
f.gets[/\s*(".+")/, 1].undump
|
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|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "zlib"
|
spec.name = "zlib"
|
||||||
spec.version = source_version
|
spec.version = source_version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user