summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEllen Marie Dash <[email protected]>2021-09-24 17:54:08 -0400
committerHiroshi SHIBATA <[email protected]>2021-09-28 17:43:42 +0900
commitfcaa918445c85c7b21d83f8eda2d237eace4b315 (patch)
treeae57d0330bdeab2b2d1feb910554ef35d3d0660f
parent6874d4f11622ab5c0ba68e5b45d1a35354eb6524 (diff)
[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
-rw-r--r--lib/rubygems/specification_policy.rb2
-rw-r--r--test/rubygems/test_gem_specification.rb14
2 files changed, 15 insertions, 1 deletions
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
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:
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