1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fixed the inconsistency gemspec location with net-* gems.

This commit is contained in:
Hiroshi SHIBATA 2020-08-05 20:01:03 +09:00
parent c87043283e
commit 8f71bb0e4f
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
5 changed files with 12 additions and 16 deletions

View file

@ -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("-"), "..").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

View file

@ -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("-"), "..").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

View file

@ -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("-"), "..").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

View file

@ -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("-"), "..").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

View file

@ -219,29 +219,25 @@ def sync_default_gems(gem)
cp_r("#{upstream}/History.md", "ext/openssl")
`git checkout ext/openssl/depend`
when "net-pop"
rm_rf(%w[lib/net/pop.rb lib/net/pop test/net/pop])
rm_rf(%w[lib/net/pop.rb lib/net/net-pop.gemspec test/net/pop])
cp_r("#{upstream}/lib/net/pop.rb", "lib/net")
cp_r("#{upstream}/lib/net/pop", "lib/net")
cp_r("#{upstream}/test/net/pop", "test/net")
cp_r("#{upstream}/net-pop.gemspec", "lib/net/pop")
cp_r("#{upstream}/net-pop.gemspec", "lib/net")
when "net-smtp"
rm_rf(%w[lib/net/smtp.rb lib/net/smtp test/net/smtp])
rm_rf(%w[lib/net/smtp.rb lib/net/net-smtp.gemspec test/net/smtp])
cp_r("#{upstream}/lib/net/smtp.rb", "lib/net")
cp_r("#{upstream}/lib/net/smtp", "lib/net")
cp_r("#{upstream}/test/net/smtp", "test/net")
cp_r("#{upstream}/net-smtp.gemspec", "lib/net/smtp")
cp_r("#{upstream}/net-smtp.gemspec", "lib/net")
when "net-protocol"
rm_rf(%w[lib/net/protocol.rb lib/net/protocol test/net/protocol])
rm_rf(%w[lib/net/protocol.rb lib/net/net-protocol.gemspec test/net/protocol])
cp_r("#{upstream}/lib/net/protocol.rb", "lib/net")
cp_r("#{upstream}/lib/net/protocol", "lib/net")
cp_r("#{upstream}/test/net/protocol", "test/net")
cp_r("#{upstream}/net-protocol.gemspec", "lib/net/protocol")
cp_r("#{upstream}/net-protocol.gemspec", "lib/net")
when "net-imap"
rm_rf(%w[lib/net/imap.rb lib/net/imap test/net/imap])
rm_rf(%w[lib/net/imap.rb lib/net/net-imap.gemspec test/net/imap])
cp_r("#{upstream}/lib/net/imap.rb", "lib/net")
cp_r("#{upstream}/lib/net/imap", "lib/net")
cp_r("#{upstream}/test/net/imap", "test/net")
cp_r("#{upstream}/net-imap.gemspec", "lib/net/imap")
cp_r("#{upstream}/net-imap.gemspec", "lib/net")
when "net-ftp"
rm_rf(%w[lib/net/ftp.rb lib/net/net-ftp.gemspec test/net/ftp])
cp_r("#{upstream}/lib/net/ftp.rb", "lib/net")