From b15350c441c94446abdc27773e713b624ec257f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 1 Feb 2018 17:27:39 +0100 Subject: [PATCH] Use 'with' operator in RPM dependency generator. --- ruby.spec | 1 + rubygems.req | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ruby.spec b/ruby.spec index 2ff939f..9b07aa2 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1063,6 +1063,7 @@ make check TESTS="-v $DISABLE_TESTS" * Tue Feb 13 2018 Vít Ondruch - 2.5.0-89 - Drop obsolete ldconfig scriptlets. - Add GMP dependency. +- Use 'with' operator in RPM dependency generator. * Fri Feb 09 2018 Fedora Release Engineering - 2.5.0-89 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/rubygems.req b/rubygems.req index 4f7a583..64c572b 100644 --- a/rubygems.req +++ b/rubygems.req @@ -52,11 +52,14 @@ module RubyGemsReq # Report all gem dependencies including their version. def self.gem_depenencies(specification) specification.runtime_dependencies.each do |dependency| - Helpers::requirement_versions_to_rpm(dependency.requirement).each do |requirement| - dependency_string = "rubygem(#{dependency.name})" - dependency_string += " #{requirement}" if requirement && requirement.length > 0 - puts dependency_string + dependency_strings = Helpers::requirement_versions_to_rpm(dependency.requirement).map do |requirement| + requirement_string = "rubygem(#{dependency.name})" + requirement_string += " #{requirement}" if requirement && 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 end