diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-01-17 15:16:34 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-01-19 11:20:36 +0900 |
commit | f04954d95c8a729d70be1c883617534a2e7cc239 (patch) | |
tree | 61146129066534cd6c29895ab45869f351be9640 /lib/rubygems/specification_policy.rb | |
parent | a892e5599ec8ec441a8d8b878efa855ef283ed08 (diff) |
[rubygems/rubygems] Normalize end alignment style with Bundler
https://github.com/rubygems/rubygems/commit/f7f504b24c
Diffstat (limited to 'lib/rubygems/specification_policy.rb')
-rw-r--r-- | lib/rubygems/specification_policy.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb index 73bd31970c..002b3c20c4 100644 --- a/lib/rubygems/specification_policy.rb +++ b/lib/rubygems/specification_policy.rb @@ -199,17 +199,17 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: base = segments.first 2 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 + " 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 @@ -332,11 +332,11 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: def validate_array_attribute(field) val = @specification.send(field) klass = case field - when :dependencies then - Gem::Dependency - else - String - end + when :dependencies then + Gem::Dependency + else + String + end unless Array === val and val.all? {|x| x.kind_of?(klass) } error "#{field} must be an Array of #{klass}" |