Properly generate "ruby(rubygems)" versioned dependencies.

This commit is contained in:
Vít Ondruch 2019-01-24 10:00:57 +01:00
parent 0c8cdc456b
commit d66ece5f5d
2 changed files with 11 additions and 5 deletions

View File

@ -21,7 +21,7 @@
%endif
%global release 110
%global release 111
%{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
# The RubyGems library has to stay out of Ruby directory tree, since the
@ -1186,6 +1186,9 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%{_mandir}/man5/gemfile.5*
%changelog
* Thu Jan 24 2019 Vít Ondruch <vondruch@redhat.com> - 2.6.0-111
- Properly generate versioned ruby(rubygems) dependencies.
* Thu Jan 17 2019 Vít Ondruch <vondruch@redhat.com> - 2.6.0-110
- Upgrade to Ruby 2.6.0.

View File

@ -42,11 +42,14 @@ module RubyGemsReq
# Report RubyGems dependency, versioned if required.
def self.rubygems_dependency(specification)
Helpers::requirement_versions_to_rpm(specification.required_rubygems_version).each do |requirement|
dependency_string = "ruby(rubygems)"
dependency_string += " #{specification.required_rubygems_version}" if requirement&.length > 0
puts dependency_string
dependency_strings = Helpers::requirement_versions_to_rpm(specification.required_rubygems_version).map do |requirement|
requirement_string = "ruby(rubygems)"
requirement_string += " #{requirement}" if requirement&.length > 0
requirement_string
end
dependency_string = dependency_strings.join(' with ')
dependency_string.prepend('(').concat(')') if dependency_strings.length > 1
puts dependency_string
end
# Report all gem dependencies including their version.