[DRE-commits] [ruby-pygments.rb] 04/09: Conditional-use-of-lexers-file-path

Cédric Boutillier boutil at moszumanska.debian.org
Sun Nov 26 21:11:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch patch-queue/master
in repository ruby-pygments.rb.

commit 13b046d47957ba8912df0d4539bed8b55604de21
Author: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
Date:   Fri Sep 29 22:48:27 2017 +0200

    Conditional-use-of-lexers-file-path
    
    
    Gbp-Pq: Name 0003-Conditional-use-of-lexers-file-path.patch
---
 lib/pygments/popen.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/pygments/popen.rb b/lib/pygments/popen.rb
index 298842e..3e43138 100644
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
@@ -149,7 +149,10 @@ module Pygments
     # Returns an array of lexers.
     def lexers
       begin
-        lexer_file = File.expand_path('../../../lexers', __FILE__)
+        # use upstream file path during build, use shipped file once installed
+        upstream_file = File.expand_path('../../../lexers', __FILE__)
+        debian_file = '/usr/share/ruby-pygments.rb/lexers'
+        lexer_file = File.exists?(debian_file) ? debian_file : upstream_file
         raw = File.open(lexer_file, "rb").read
         Marshal.load(raw)
       rescue Errno::ENOENT

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pygments.rb.git



More information about the Pkg-ruby-extras-commits mailing list