forked from pool/rubygem-gem2rpm
Marcus Rueckert
2c88c1595d
- dropped all patches and replaced them with git format-patch series: - modified: 0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch 0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch 0003-new-opensuse-templates.-they-require-the-config-file.patch 0004-added-example-gem2rpm.yml.patch 0005-properly-shorten-description-and-summary.patch 0006-Preserve-the-license-header-found-in-the-output-file.patch 0007-fixes-for-the-opensuse-template.patch 0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch 0009-No-longer-require-the-ruby-version-inside-the-subpac.patch 0010-Try-to-load-rbconfigpackagingsupport-and-fail-gracef.patch 0011-Add-support-for-scripts-pre-post-for-subpackages.patch 0012-typo-in-gem2rpm.yml.documentation-custom_pkgs-instea.patch 0013-Also-tag-LICENSE-MIT-as-docfile.patch 0014-Refactor-into-multiple-lines.patch 0015-Add-licence-to-the-list-of-license-files-as-well.patch 0016-add-two-more-ways-to-express-changes.patch - dropped: 0017-touch-unpacked-sources.patch 0001-Also-tag-APACHE-LICENSE-2.0-as-docfile.patch - newly added: 0017-.markdown-is-also-seen-in-the-wild.patch 0018-Only-use-the-extensions-doc-dir-on-MRI-2.1.x.patch 0019-Cleaner-solution-for-the-extensions-doc-dir.patch 0020-Ruby-1.8-insists-on-the-for-the-parameter.patch 0021-Fix-company-name-in-copyright-header.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=20
59 lines
1.8 KiB
Diff
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/25] 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.10.1
|
|
|