mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
f27e0d90c8
It loads `ext/fiddle/lib/fiddle/version.rb`, which causes constant redefinition warning: http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200523T153003Z.log.html.gz ``` [ 6317/20193] TestDefaultGems#test_validate_gemspec/home/chkbuild/chkbuild/tmp/build/20200523T153003Z/ruby/ext/fiddle/lib/fiddle/version.rb:2: warning: already initialized constant Fiddle::VERSION /home/chkbuild/chkbuild/tmp/build/20200523T153003Z/ruby/.ext/common/fiddle/version.rb:2: warning: previous definition of VERSION was here = 0.16 s ``` This changeset read the version by manual parsing hack which is also used in stringio and zlib.
64 lines
1.8 KiB
Ruby
64 lines
1.8 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
source_version = ["", "ext/fiddle/"].find do |dir|
|
|
begin
|
|
break File.open(File.join(__dir__, "#{dir}lib/fiddle/version.rb")) {|f|
|
|
f.gets("\n VERSION = ")
|
|
f.gets[/\s*"(.+)"/, 1]
|
|
}
|
|
rescue Errno::ENOENT
|
|
end
|
|
end
|
|
|
|
Gem::Specification.new do |spec|
|
|
spec.name = "fiddle"
|
|
spec.version = source_version
|
|
spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
|
|
spec.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"]
|
|
|
|
spec.summary = %q{A libffi wrapper for Ruby.}
|
|
spec.description = %q{A libffi wrapper for Ruby.}
|
|
spec.homepage = "https://github.com/ruby/fiddle"
|
|
spec.license = "BSD-2-Clause"
|
|
|
|
spec.files = [
|
|
"LICENSE.txt",
|
|
"README.md",
|
|
"Rakefile",
|
|
"ext/fiddle/closure.c",
|
|
"ext/fiddle/closure.h",
|
|
"ext/fiddle/conversions.c",
|
|
"ext/fiddle/conversions.h",
|
|
"ext/fiddle/extconf.rb",
|
|
"ext/fiddle/extlibs",
|
|
"ext/fiddle/fiddle.c",
|
|
"ext/fiddle/fiddle.h",
|
|
"ext/fiddle/function.c",
|
|
"ext/fiddle/function.h",
|
|
"ext/fiddle/handle.c",
|
|
"ext/fiddle/pointer.c",
|
|
"ext/fiddle/win32/fficonfig.h",
|
|
"ext/fiddle/win32/libffi-3.2.1-mswin.patch",
|
|
"ext/fiddle/win32/libffi-config.rb",
|
|
"ext/fiddle/win32/libffi.mk.tmpl",
|
|
"fiddle.gemspec",
|
|
"lib/fiddle.rb",
|
|
"lib/fiddle/closure.rb",
|
|
"lib/fiddle/cparser.rb",
|
|
"lib/fiddle/function.rb",
|
|
"lib/fiddle/import.rb",
|
|
"lib/fiddle/pack.rb",
|
|
"lib/fiddle/struct.rb",
|
|
"lib/fiddle/types.rb",
|
|
"lib/fiddle/value.rb",
|
|
"lib/fiddle/version.rb",
|
|
]
|
|
spec.require_paths = ["lib"]
|
|
spec.extensions = ["ext/fiddle/extconf.rb"]
|
|
|
|
spec.required_ruby_version = ">= 2.3.0"
|
|
|
|
spec.add_development_dependency "bundler"
|
|
spec.add_development_dependency "rake"
|
|
spec.add_development_dependency "rake-compiler"
|
|
end
|