1 # frozen_string_literal: true
3 name = File.basename(__FILE__, ".gemspec")
4 version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir|
5 break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
6 /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
10 Gem::Specification.new do |spec|
12 spec.version = version
13 spec.authors = ["Yukihiro Matsumoto"]
14 spec.email = ["matz@ruby-lang.org"]
16 spec.summary = %q{Allows a referenced object to be garbage-collected.}
17 spec.description = %q{Allows a referenced object to be garbage-collected.}
18 spec.homepage = "https://github.com/ruby/weakref"
20 spec.metadata["homepage_uri"] = spec.homepage
21 spec.metadata["source_code_uri"] = "https://github.com/ruby/weakref"
22 spec.licenses = ["Ruby", "BSD-2-Clause"]
24 # Specify which files should be added to the gem when it is released.
25 # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26 spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
27 `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30 spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31 spec.require_paths = ["lib"]
33 spec.add_dependency "delegate"