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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Description: fix relative path for file outside lib
load the file from /usr/share/ruby-twitter-text path
.
Debian specific
Author: Pirate Praveen <praveen@debian.org>
Last-Update: 2014-11-23
--- a/lib/twitter-text/regex.rb
+++ b/lib/twitter-text/regex.rb
@@ -26,12 +26,23 @@
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
--- a/test/conformance_test.rb
+++ b/test/conformance_test.rb
@@ -62,7 +62,7 @@
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))
|