[前][次][番号順一覧][スレッド一覧]

ruby-changes:68160

From: Ellen <ko1@a...>
Date: Tue, 28 Sep 2021 19:15:59 +0900 (JST)
Subject: [ruby-changes:68160] fcaa918445 (master): [rubygems/rubygems] Only disallow FIXME/TODO for first word of gemspec description

https://git.ruby-lang.org/ruby.git/commit/?id=fcaa918445

From fcaa918445c85c7b21d83f8eda2d237eace4b315 Mon Sep 17 00:00:00 2001
From: Ellen Marie Dash <me@d...>
Date: Fri, 24 Sep 2021 17:54:08 -0400
Subject: [rubygems/rubygems] Only disallow FIXME/TODO for first word of
 gemspec description

7890c98 matched the start of each line, whereas this matches the start
of the entire string.

https://github.com/rubygems/rubygems/commit/432de7b819
---
 lib/rubygems/specification_policy.rb    |  2 +-
 test/rubygems/test_gem_specification.rb | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb
index c30ec707d9..73bd31970c 100644
--- a/lib/rubygems/specification_policy.rb
+++ b/lib/rubygems/specification_policy.rb
@@ -381,7 +381,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification_policy.rb#L381
   end
 
   LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, '')
-  LAZY_PATTERN = /^FI XME|^TO DO/x.freeze
+  LAZY_PATTERN = /\AFI XME|\ATO DO/x.freeze
   HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze
 
   def validate_lazy_metadata
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 782ae0380f..336fcf000e 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -2795,6 +2795,20 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L2795
       assert_nothing_raised do
         @a1.validate
       end
+
+      # Adding #{f} at the start of the second or later line should be fine.
+      @a1.description = "(some description)\n#{f}"
+
+      assert_nothing_raised do
+        @a1.validate
+      end
+
+      # Adding #{t} at the start of the second or later line should be fine.
+      @a1.description = "(some description)\n#{t}"
+
+      assert_nothing_raised do
+        @a1.validate
+      end
     end
   end
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]