From d1237bc3a43ed87d9a8c574cfbb7e0399ae0ee76 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 25 May 2023 15:47:48 +0900 Subject: [PATCH] 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 => }/delegate.gemspec | 2 +- lib/{getoptlong => }/getoptlong.gemspec | 2 +- lib/{observer => }/observer.gemspec | 2 +- lib/{ostruct => }/ostruct.gemspec | 2 +- lib/{pstore => }/pstore.gemspec | 2 +- lib/{singleton => }/singleton.gemspec | 2 +- lib/{timeout => }/timeout.gemspec | 2 +- lib/{weakref => }/weakref.gemspec | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename lib/{delegate => }/delegate.gemspec (93%) rename lib/{getoptlong => }/getoptlong.gemspec (93%) rename lib/{observer => }/observer.gemspec (94%) rename lib/{ostruct => }/ostruct.gemspec (92%) rename lib/{pstore => }/pstore.gemspec (94%) rename lib/{singleton => }/singleton.gemspec (93%) rename lib/{timeout => }/timeout.gemspec (93%) rename lib/{weakref => }/weakref.gemspec (94%) diff --git a/lib/delegate/delegate.gemspec b/lib/delegate.gemspec similarity index 93% rename from lib/delegate/delegate.gemspec rename to lib/delegate.gemspec index 071c7f1e08..6c3feac74b 100644 --- a/lib/delegate/delegate.gemspec +++ b/lib/delegate.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/getoptlong/getoptlong.gemspec b/lib/getoptlong.gemspec similarity index 93% rename from lib/getoptlong/getoptlong.gemspec rename to lib/getoptlong.gemspec index 326f899acd..c2f65dcaab 100644 --- a/lib/getoptlong/getoptlong.gemspec +++ b/lib/getoptlong.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/observer/observer.gemspec b/lib/observer.gemspec similarity index 94% rename from lib/observer/observer.gemspec rename to lib/observer.gemspec index d9f3117827..93e61b8c84 100644 --- a/lib/observer/observer.gemspec +++ b/lib/observer.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/ostruct/ostruct.gemspec b/lib/ostruct.gemspec similarity index 92% rename from lib/ostruct/ostruct.gemspec rename to lib/ostruct.gemspec index 31ecc312c3..21cce18226 100644 --- a/lib/ostruct/ostruct.gemspec +++ b/lib/ostruct.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/pstore/pstore.gemspec b/lib/pstore.gemspec similarity index 94% rename from lib/pstore/pstore.gemspec rename to lib/pstore.gemspec index 9b1c17f6b9..86051d2f43 100644 --- a/lib/pstore/pstore.gemspec +++ b/lib/pstore.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/singleton/singleton.gemspec b/lib/singleton.gemspec similarity index 93% rename from lib/singleton/singleton.gemspec rename to lib/singleton.gemspec index 05d3296215..7646914905 100644 --- a/lib/singleton/singleton.gemspec +++ b/lib/singleton.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/timeout/timeout.gemspec b/lib/timeout.gemspec similarity index 93% rename from lib/timeout/timeout.gemspec rename to lib/timeout.gemspec index 7449ae1980..23c6e5fe95 100644 --- a/lib/timeout/timeout.gemspec +++ b/lib/timeout.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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 diff --git a/lib/weakref/weakref.gemspec b/lib/weakref.gemspec similarity index 94% rename from lib/weakref/weakref.gemspec rename to lib/weakref.gemspec index 2d4a89a06a..03893f77e6 100644 --- a/lib/weakref/weakref.gemspec +++ b/lib/weakref.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| +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