From d1237bc3a43ed87d9a8c574cfbb7e0399ae0ee76 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 25 May 2023 15:47:48 +0900 Subject: Move gemspec files to top of lib directory. They have version.rb files with same directory. But version.rb have been removed at https://github.com/ruby/ruby/pull/3375 There is no reason to locate under the library name of directory. --- lib/delegate.gemspec | 29 +++++++++++++++++++++++++++++ lib/delegate/delegate.gemspec | 29 ----------------------------- lib/getoptlong.gemspec | 30 ++++++++++++++++++++++++++++++ lib/getoptlong/getoptlong.gemspec | 30 ------------------------------ lib/observer.gemspec | 32 ++++++++++++++++++++++++++++++++ lib/observer/observer.gemspec | 32 -------------------------------- lib/ostruct.gemspec | 27 +++++++++++++++++++++++++++ lib/ostruct/ostruct.gemspec | 27 --------------------------- lib/pstore.gemspec | 32 ++++++++++++++++++++++++++++++++ lib/pstore/pstore.gemspec | 32 -------------------------------- lib/singleton.gemspec | 30 ++++++++++++++++++++++++++++++ lib/singleton/singleton.gemspec | 30 ------------------------------ lib/timeout.gemspec | 30 ++++++++++++++++++++++++++++++ lib/timeout/timeout.gemspec | 30 ------------------------------ lib/weakref.gemspec | 34 ++++++++++++++++++++++++++++++++++ lib/weakref/weakref.gemspec | 34 ---------------------------------- 16 files changed, 244 insertions(+), 244 deletions(-) create mode 100644 lib/delegate.gemspec delete mode 100644 lib/delegate/delegate.gemspec create mode 100644 lib/getoptlong.gemspec delete mode 100644 lib/getoptlong/getoptlong.gemspec create mode 100644 lib/observer.gemspec delete mode 100644 lib/observer/observer.gemspec create mode 100644 lib/ostruct.gemspec delete mode 100644 lib/ostruct/ostruct.gemspec create mode 100644 lib/pstore.gemspec delete mode 100644 lib/pstore/pstore.gemspec create mode 100644 lib/singleton.gemspec delete mode 100644 lib/singleton/singleton.gemspec create mode 100644 lib/timeout.gemspec delete mode 100644 lib/timeout/timeout.gemspec create mode 100644 lib/weakref.gemspec delete mode 100644 lib/weakref/weakref.gemspec diff --git a/lib/delegate.gemspec b/lib/delegate.gemspec new file mode 100644 index 0000000000..6c3feac74b --- /dev/null +++ b/lib/delegate.gemspec @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{Provides three abilities to delegate method calls to an object.} + spec.description = %q{Provides three abilities to delegate method calls to an object.} + spec.homepage = "https://github.com/ruby/delegate" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.require_paths = ["lib"] + spec.required_ruby_version = '>= 2.7' +end diff --git a/lib/delegate/delegate.gemspec b/lib/delegate/delegate.gemspec deleted file mode 100644 index 071c7f1e08..0000000000 --- a/lib/delegate/delegate.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{Provides three abilities to delegate method calls to an object.} - spec.description = %q{Provides three abilities to delegate method calls to an object.} - spec.homepage = "https://github.com/ruby/delegate" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.require_paths = ["lib"] - spec.required_ruby_version = '>= 2.7' -end diff --git a/lib/getoptlong.gemspec b/lib/getoptlong.gemspec new file mode 100644 index 0000000000..c2f65dcaab --- /dev/null +++ b/lib/getoptlong.gemspec @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{GetoptLong for Ruby} + spec.description = spec.summary + spec.homepage = "https://github.com/ruby/getoptlong" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.require_paths = ["lib"] +end diff --git a/lib/getoptlong/getoptlong.gemspec b/lib/getoptlong/getoptlong.gemspec deleted file mode 100644 index 326f899acd..0000000000 --- a/lib/getoptlong/getoptlong.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{GetoptLong for Ruby} - spec.description = spec.summary - spec.homepage = "https://github.com/ruby/getoptlong" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.require_paths = ["lib"] -end diff --git a/lib/observer.gemspec b/lib/observer.gemspec new file mode 100644 index 0000000000..93e61b8c84 --- /dev/null +++ b/lib/observer.gemspec @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{Implementation of the Observer object-oriented design pattern.} + spec.description = spec.summary + spec.homepage = "https://github.com/ruby/observer" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] +end diff --git a/lib/observer/observer.gemspec b/lib/observer/observer.gemspec deleted file mode 100644 index d9f3117827..0000000000 --- a/lib/observer/observer.gemspec +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{Implementation of the Observer object-oriented design pattern.} - spec.description = spec.summary - spec.homepage = "https://github.com/ruby/observer" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] -end diff --git a/lib/ostruct.gemspec b/lib/ostruct.gemspec new file mode 100644 index 0000000000..21cce18226 --- /dev/null +++ b/lib/ostruct.gemspec @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Marc-Andre Lafortune"] + spec.email = ["ruby-core@marc-andre.ca"] + + spec.summary = %q{Class to build custom data structures, similar to a Hash.} + spec.description = %q{Class to build custom data structures, similar to a Hash.} + spec.homepage = "https://github.com/ruby/ostruct" + spec.licenses = ["Ruby", "BSD-2-Clause"] + spec.required_ruby_version = ">= 2.5.0" + + spec.files = [".gitignore", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/ostruct.rb", "ostruct.gemspec"] + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler" + spec.add_development_dependency "rake" +end diff --git a/lib/ostruct/ostruct.gemspec b/lib/ostruct/ostruct.gemspec deleted file mode 100644 index 31ecc312c3..0000000000 --- a/lib/ostruct/ostruct.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Marc-Andre Lafortune"] - spec.email = ["ruby-core@marc-andre.ca"] - - spec.summary = %q{Class to build custom data structures, similar to a Hash.} - spec.description = %q{Class to build custom data structures, similar to a Hash.} - spec.homepage = "https://github.com/ruby/ostruct" - spec.licenses = ["Ruby", "BSD-2-Clause"] - spec.required_ruby_version = ">= 2.5.0" - - spec.files = [".gitignore", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/ostruct.rb", "ostruct.gemspec"] - spec.require_paths = ["lib"] - - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake" -end diff --git a/lib/pstore.gemspec b/lib/pstore.gemspec new file mode 100644 index 0000000000..86051d2f43 --- /dev/null +++ b/lib/pstore.gemspec @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{Transactional File Storage for Ruby Objects} + spec.description = spec.summary + spec.homepage = "https://github.com/ruby/pstore" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "https://github.com/ruby/pstore" + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] +end diff --git a/lib/pstore/pstore.gemspec b/lib/pstore/pstore.gemspec deleted file mode 100644 index 9b1c17f6b9..0000000000 --- a/lib/pstore/pstore.gemspec +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{Transactional File Storage for Ruby Objects} - spec.description = spec.summary - spec.homepage = "https://github.com/ruby/pstore" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/ruby/pstore" - - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] -end diff --git a/lib/singleton.gemspec b/lib/singleton.gemspec new file mode 100644 index 0000000000..7646914905 --- /dev/null +++ b/lib/singleton.gemspec @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{The Singleton module implements the Singleton pattern.} + spec.description = spec.summary + spec.homepage = "https://github.com/ruby/singleton" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] +end diff --git a/lib/singleton/singleton.gemspec b/lib/singleton/singleton.gemspec deleted file mode 100644 index 05d3296215..0000000000 --- a/lib/singleton/singleton.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{The Singleton module implements the Singleton pattern.} - spec.description = spec.summary - spec.homepage = "https://github.com/ruby/singleton" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] -end diff --git a/lib/timeout.gemspec b/lib/timeout.gemspec new file mode 100644 index 0000000000..23c6e5fe95 --- /dev/null +++ b/lib/timeout.gemspec @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{Auto-terminate potentially long-running operations in Ruby.} + spec.description = %q{Auto-terminate potentially long-running operations in Ruby.} + spec.homepage = "https://github.com/ruby/timeout" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + spec.files = Dir.chdir(__dir__) do + `git ls-files -z`.split("\x0").reject do |f| + (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|rakelib)/|\.(?:git|travis|circleci)|appveyor|Rakefile)}) + end + end + spec.require_paths = ["lib"] +end diff --git a/lib/timeout/timeout.gemspec b/lib/timeout/timeout.gemspec deleted file mode 100644 index 7449ae1980..0000000000 --- a/lib/timeout/timeout.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{Auto-terminate potentially long-running operations in Ruby.} - spec.description = %q{Auto-terminate potentially long-running operations in Ruby.} - spec.homepage = "https://github.com/ruby/timeout" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - spec.files = Dir.chdir(__dir__) do - `git ls-files -z`.split("\x0").reject do |f| - (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|rakelib)/|\.(?:git|travis|circleci)|appveyor|Rakefile)}) - end - end - spec.require_paths = ["lib"] -end diff --git a/lib/weakref.gemspec b/lib/weakref.gemspec new file mode 100644 index 0000000000..03893f77e6 --- /dev/null +++ b/lib/weakref.gemspec @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +name = File.basename(__FILE__, ".gemspec") +version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir| + break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end rescue nil +end + +Gem::Specification.new do |spec| + spec.name = name + spec.version = version + spec.authors = ["Yukihiro Matsumoto"] + spec.email = ["matz@ruby-lang.org"] + + spec.summary = %q{Allows a referenced object to be garbage-collected.} + spec.description = %q{Allows a referenced object to be garbage-collected.} + spec.homepage = "https://github.com/ruby/weakref" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "https://github.com/ruby/weakref" + spec.licenses = ["Ruby", "BSD-2-Clause"] + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_dependency "delegate" +end diff --git a/lib/weakref/weakref.gemspec b/lib/weakref/weakref.gemspec deleted file mode 100644 index 2d4a89a06a..0000000000 --- a/lib/weakref/weakref.gemspec +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@ruby-lang.org"] - - spec.summary = %q{Allows a referenced object to be garbage-collected.} - spec.description = %q{Allows a referenced object to be garbage-collected.} - spec.homepage = "https://github.com/ruby/weakref" - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/ruby/weakref" - spec.licenses = ["Ruby", "BSD-2-Clause"] - - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - - spec.add_dependency "delegate" -end -- cgit v1.2.3