rubygem-gem2rpm/0005-properly-shorten-description-and-summary.patch
Stephan Kulow 9f40853891 - Update from git. Add:
A    0027-quote-version_suffix-in-gem2rpm.yml.documentation-to.patch
A    0028-add-binary_map-support.patch
A    0029-Use-or-for-the-conditions-instead-of-and.patch
A    0030-gem_package.spec.erb-sync-with-ruby-common.patch
A    0031-use-template-opensuse-on-openSUSE-Tumbleweed-where-e.patch
A    0032-Replace-no-rdoc-no-ri-with-no-document.patch
And refresh all others
Remove:
D    binary_map.patch
D    enhances.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=35
2019-02-23 07:09:23 +00:00

59 lines
1.8 KiB
Diff

From da07cd470611c3c6b70fc863e2d82a2862a068e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
Date: Thu, 24 Jul 2014 17:09:35 +0200
Subject: [PATCH 05/32] properly shorten description and summary
This also includes the description if we reuse the summary.
---
lib/gem2rpm.rb | 1 -
lib/gem2rpm/specification.rb | 14 ++++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb
index e5e2693..5261ae1 100644
--- a/lib/gem2rpm.rb
+++ b/lib/gem2rpm.rb
@@ -36,7 +36,6 @@ module Gem2Rpm
# Deprecate, kept just for backward compatibility.
format = Gem2Rpm::Format.new(package)
spec = Gem2Rpm::Specification.new(package.spec)
- spec.description ||= spec.summary
config ||= {}
download_path = ""
unless local
diff --git a/lib/gem2rpm/specification.rb b/lib/gem2rpm/specification.rb
index 9a8d5a1..2e4f7b2 100644
--- a/lib/gem2rpm/specification.rb
+++ b/lib/gem2rpm/specification.rb
@@ -7,6 +7,9 @@ module Gem2Rpm
# A long description of gem wrapped to 78 characters.
def description
d = super.to_s.chomp
+ if d.nil? or d.empty?
+ d=self.__getobj__().summary
+ end
d.gsub!(/([^.])\Z/, "\\1.")
Helpers::word_wrap(d, 78) + "\n"
end
@@ -17,6 +20,17 @@ module Gem2Rpm
super.map {|d| Gem2Rpm::Dependency.new d}
end
+ # a short summary trimmed to 70 characters
+ def summary
+ text = super
+ if text.length >= 70
+ text = text[0,70].split(/\s/)
+ text = text[0, text.length-1].join(" ")
+ end
+ text = text[0, text.length-1] if text[-1] == '.'
+ text
+ end
+
# List of dependencies that are used for development.
def development_dependencies
super.map {|d| Gem2Rpm::Dependency.new d}
--
2.20.1