File: use_debian_datadir.patch

package info (click to toggle)
ruby-unicode-display-width 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 148 kB
  • sloc: ruby: 278; makefile: 3
file content (12 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
--- a/lib/unicode/display_width/constants.rb
+++ b/lib/unicode/display_width/constants.rb
@@ -4,7 +4,8 @@ module Unicode
   class DisplayWidth
     VERSION = "3.2.0"
     UNICODE_VERSION = "17.0.0"
-    DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/")
+    DEBIAN_DATA_DIRECTORY = '/usr/share/ruby-unicode-display-width/'
+    DATA_DIRECTORY = (File.directory?(DEBIAN_DATA_DIRECTORY) ? DEBIAN_DATA_DIRECTORY : File.expand_path(File.dirname(__FILE__) + '/../../../data/')).freeze
     INDEX_FILENAME = DATA_DIRECTORY + "/display_width.marshal.gz"
   end
 end