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
|