File: read-gem-version.patch

package info (click to toggle)
ruby-kramdown-rfc2629 1.7.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 524 kB
  • sloc: ruby: 3,907; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: =?utf-8?q?C=C3=A9dric_Boutillier?= <boutil@debian.org>
Date: Thu, 21 Apr 2022 15:29:21 -0400
Subject: Read version from gemspec

The corresponding gemspec may not be loaded even if we require
"kramdown-rfc2629"

Bug-Debian: https://bugs.debian.org/983057
---
 lib/kramdown-rfc/command.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kramdown-rfc/command.rb b/lib/kramdown-rfc/command.rb
index 7ff5ddf..77cd75b 100755
--- a/lib/kramdown-rfc/command.rb
+++ b/lib/kramdown-rfc/command.rb
@@ -9,7 +9,7 @@ require 'kramdown-rfc/erb'
 require 'date'
 
 # try to get this from gemspec.
-KDRFC_VERSION=Gem.loaded_specs["kramdown-rfc2629"].version rescue "unknown-version"
+KDRFC_VERSION=Gem::Specification.find_by_name("kramdown-rfc2629").version rescue "unknown-version"
 
 Encoding.default_external = "UTF-8" # wake up, smell the coffee