File: 0200_replace_BASEDIR_data_by_DATADIR.patch

package info (click to toggle)
ruby-prawn 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,528 kB
  • sloc: ruby: 17,688; sh: 43; makefile: 20
file content (29 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download
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
26
27
28
29
Description: redefine BASEDIR and DATADIR
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2019-01-07

--- a/lib/prawn.rb
+++ b/lib/prawn.rb
@@ -15,8 +15,9 @@ module Prawn
   # The base source directory for Prawn as installed on the system.
   BASEDIR = File.expand_path(File.join(dir, '..'))
 
-  # Directory where Prawn keeps its data files.
-  DATADIR = File.expand_path(File.join(dir, '..', 'data'))
+  # Definition of a data directory that may be not in BASEDIR/data (Debian patch)
+  # /usr/lib/ruby/vendor_ruby/prawn -> /usr/share/ruby-prawn/
+  DATADIR = File.expand_path(File.join(dir, '..', '..', '..', 'share', 'ruby-prawn'))
 
   # @deprecated This is not used any more.
   FLOAT_PRECISION = 1.0e-9
--- a/spec/prawn/images/png_spec.rb
+++ b/spec/prawn/images/png_spec.rb
@@ -11,7 +11,7 @@ require 'spec_helper'
 
 describe Prawn::Images::PNG do
   describe 'When making a pdf file with png images' do
-    image_dir = "#{Prawn::BASEDIR}/data/images"
+    image_dir = "#{Prawn::DATADIR}/images"
     images = [
       ['Type 0', "#{image_dir}/web-links.png"],
       ['Type 0 with transparency', "#{image_dir}/ruport_type0.png"],