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

Merge rubygems@21f12a8 from upstream.

* [BudlerVersionFinder] set .filter! and .compatible? to match only on major versions https://github.com/rubygems/rubygems/pull/2515
  * Fix broken symlink that points to ../* https://github.com/rubygems/rubygems/pull/2516

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2018-12-12 05:07:50 +00:00
parent 53a5b276b8
commit 7f9bf068fc
12 changed files with 90 additions and 54 deletions

View file

@ -150,19 +150,24 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
if open_ended
op, dep_version = dep.requirement.requirements.first
base = dep_version.segments.first 2
segments = dep_version.segments
bugfix = if op == '>'
", '> #{dep_version}'"
elsif op == '>=' and base != dep_version.segments
", '>= #{dep_version}'"
end
base = segments.first 2
warning_messages << <<-WARNING
open-ended dependency on #{dep} is not recommended
if #{dep.name} is semantically versioned, use:
add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}
WARNING
recommendation = if (op == '>' || op == '>=') && segments == [0]
" use a bounded requirement, such as '~> x.y'"
else
bugfix = if op == '>'
", '> #{dep_version}'"
elsif op == '>=' and base != segments
", '>= #{dep_version}'"
end
" if #{dep.name} is semantically versioned, use:\n" \
" add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}"
end
warning_messages << ["open-ended dependency on #{dep} is not recommended", recommendation].join("\n") + "\n"
end
end
if error_messages.any?