[rubygems/rubygems] Use double-quotes instead of single-quotes in warnings

https://github.com/rubygems/rubygems/commit/c7f1cb9941
This commit is contained in:
Hiroshi SHIBATA 2023-03-27 12:06:12 +09:00
Родитель 9cfd8330ca
Коммит cd4b4ac737
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -162,7 +162,7 @@ class Gem::SpecificationPolicy
if prev = seen[dep.type][dep.name]
error_messages << <<-MESSAGE
duplicate dependency on #{dep}, (#{prev.requirement}) use:
add_#{dep.type}_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}'
add_#{dep.type}_dependency \"#{dep.name}\", \"#{dep.requirement}\", \"#{prev.requirement}\"
MESSAGE
end
@ -205,16 +205,16 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
base = segments.first 2
recommendation = if [">", ">="].include?(op) && segments == [0]
" use a bounded requirement, such as '~> x.y'"
" use a bounded requirement, such as \"~> x.y\""
else
bugfix = if op == ">"
", '> #{dep_version}'"
", \"> #{dep_version}\""
elsif op == ">=" && base != segments
", '>= #{dep_version}'"
", \">= #{dep_version}\""
end
" if #{dep.name} is semantically versioned, use:\n" \
" add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join "."}'#{bugfix}"
" add_#{dep.type}_dependency \"#{dep.name}\", \"~> #{base.join "."}\"#{bugfix}"
end
warning_messages << ["open-ended dependency on #{dep} is not recommended", recommendation].join("\n") + "\n"

Просмотреть файл

@ -2610,18 +2610,18 @@ end
#{w}: prerelease dependency on c (>= 2.0.rc2, development) is not recommended
#{w}: open-ended dependency on i (>= 1.2) is not recommended
if i is semantically versioned, use:
add_runtime_dependency 'i', '~> 1.2'
add_runtime_dependency "i", "~> 1.2"
#{w}: open-ended dependency on j (>= 1.2.3) is not recommended
if j is semantically versioned, use:
add_runtime_dependency 'j', '~> 1.2', '>= 1.2.3'
add_runtime_dependency "j", "~> 1.2", ">= 1.2.3"
#{w}: open-ended dependency on k (> 1.2) is not recommended
if k is semantically versioned, use:
add_runtime_dependency 'k', '~> 1.2', '> 1.2'
add_runtime_dependency "k", "~> 1.2", "> 1.2"
#{w}: open-ended dependency on l (> 1.2.3) is not recommended
if l is semantically versioned, use:
add_runtime_dependency 'l', '~> 1.2', '> 1.2.3'
add_runtime_dependency "l", "~> 1.2", "> 1.2.3"
#{w}: open-ended dependency on o (>= 0) is not recommended
use a bounded requirement, such as '~> x.y'
use a bounded requirement, such as "~> x.y"
#{w}: See https://guides.rubygems.org/specification-reference/ for help
EXPECTED
@ -2645,9 +2645,9 @@ end
expected = <<-EXPECTED
duplicate dependency on b (>= 1.2.3), (~> 1.2) use:
add_runtime_dependency 'b', '>= 1.2.3', '~> 1.2'
add_runtime_dependency "b", ">= 1.2.3", "~> 1.2"
duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
add_development_dependency 'c', '>= 1.2.3', '~> 1.2'
add_development_dependency "c", ">= 1.2.3", "~> 1.2"
EXPECTED
assert_equal expected, e.message