From: Pirate Praveen <praveen@debian.org>
Date: Sun, 23 Nov 2014 05:34:49 +0530
Subject: fix relative path for file outside lib

Last-Update: 2014-11-23
Forwarded: no (Debian specific)

load the file from /usr/share/ruby-twitter-text path
---
 lib/twitter-text/regex.rb | 11 +++++++++++
 test/conformance_test.rb  |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/twitter-text/regex.rb b/lib/twitter-text/regex.rb
index 8886e5f..ec4c709 100644
--- a/lib/twitter-text/regex.rb
+++ b/lib/twitter-text/regex.rb
@@ -26,12 +26,23 @@ module Twitter
       end
     end
 
+    if File.exists?(File.expand_path('../../../../../share/ruby-twitter-text', __FILE__))
+    TLDS = YAML.load_file(
+      File.join(
+        File.expand_path('../../../../../share/ruby-twitter-text', __FILE__), # project root
+        'lib', 'assets', 'tld_lib.yml'
+      )
+    )
+    else
     TLDS = YAML.load_file(
       File.join(
         File.expand_path('../../..', __FILE__), # project root
         'lib', 'assets', 'tld_lib.yml'
       )
     )
+    end
+
+
 
     # Space is more than %20, U+3000 for example is the full-width space used with Kanji. Provide a short-hand
     # to access both the list of characters and a pattern suitible for use with String#split
diff --git a/test/conformance_test.rb b/test/conformance_test.rb
index ac7112f..9dbc7d3 100644
--- a/test/conformance_test.rb
+++ b/test/conformance_test.rb
@@ -62,7 +62,7 @@ class ConformanceTest < Test::Unit::TestCase
     element.attribute_nodes.map{|attr| [attr.name, attr.value]}.sort
   end
 
-  CONFORMANCE_DIR = ENV['CONFORMANCE_DIR'] || File.expand_path("../../../conformance", __FILE__)
+  CONFORMANCE_DIR = ENV['CONFORMANCE_DIR'] || File.expand_path("../twitter-text-conformance", __FILE__)
 
   def self.def_conformance_test(file, test_type, &block)
     yaml = YAML.load_file(File.join(CONFORMANCE_DIR, file))
