twitter-text 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/regex.rb +3 -3
- data/spec/autolinking_spec.rb +3 -3
- data/spec/regex_spec.rb +0 -6
- metadata +4 -4
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ require 'digest'
|
|
9
9
|
|
10
10
|
spec = Gem::Specification.new do |s|
|
11
11
|
s.name = "twitter-text"
|
12
|
-
s.version = "1.1.
|
12
|
+
s.version = "1.1.7"
|
13
13
|
s.authors = ["Matt Sanford", "Patrick Ewing", "Ben Cherry", "Britt Selvitelle", "Raffi Krikorian"]
|
14
14
|
s.email = ["matt@twitter.com", "patrick.henry.ewing@gmail.com", "bcherry@gmail.com", "bs@brittspace.com", "raffi@twitter.com"]
|
15
15
|
s.homepage = "http://twitter.com"
|
data/lib/regex.rb
CHANGED
@@ -33,9 +33,9 @@ module Twitter
|
|
33
33
|
|
34
34
|
major, minor, patch = RUBY_VERSION.split(/\./)
|
35
35
|
if major.to_i >= 1 && minor.to_i >= 9
|
36
|
-
REGEXEN[:list_name] =
|
36
|
+
REGEXEN[:list_name] = /[a-zA-Z][a-zA-Z0-9_\-\u0080-\u00ff]{0,24}/
|
37
37
|
else
|
38
|
-
REGEXEN[:list_name] =
|
38
|
+
REGEXEN[:list_name] = /[a-zA-Z][a-zA-Z0-9_\-\x80-\xff]{0,24}/
|
39
39
|
end
|
40
40
|
|
41
41
|
# Latin accented characters (subtracted 0xD7 from the range, it's a confusable multiplication sign. Looks like "x")
|
@@ -45,7 +45,7 @@ module Twitter
|
|
45
45
|
# Characters considered valid in a hashtag but not at the beginning, where only a-z and 0-9 are valid.
|
46
46
|
HASHTAG_CHARACTERS = /[a-z0-9_#{LATIN_ACCENTS}]/io
|
47
47
|
REGEXEN[:auto_link_hashtags] = /(^|[^0-9A-Z&\/]+)(#|#)([0-9A-Z_]*[A-Z_]+#{HASHTAG_CHARACTERS}*)/io
|
48
|
-
REGEXEN[:auto_link_usernames_or_lists] = /([^a-zA-Z0-9_]|^)([@@]+)([a-zA-Z0-9_]{1,20})(
|
48
|
+
REGEXEN[:auto_link_usernames_or_lists] = /([^a-zA-Z0-9_]|^)([@@]+)([a-zA-Z0-9_]{1,20})(\/#{REGEXEN[:list_name]})?/o
|
49
49
|
REGEXEN[:auto_link_emoticon] = /(8\-\#|8\-E|\+\-\(|\`\@|\`O|\<\|:~\(|\}:o\{|:\-\[|\>o\<|X\-\/|\[:-\]\-I\-|\/\/\/\/Ö\\\\\\\\|\(\|:\|\/\)|∑:\*\)|\( \| \))/
|
50
50
|
|
51
51
|
# URL related hash regex collection
|
data/spec/autolinking_spec.rb
CHANGED
@@ -171,12 +171,12 @@ describe Twitter::Autolink do
|
|
171
171
|
|
172
172
|
context "username over twenty characters" do
|
173
173
|
def original_text
|
174
|
-
@
|
175
|
-
"@#{@
|
174
|
+
@twentyfive_character_list = "jack/" + ("a" * 25)
|
175
|
+
"@#{@twentyfive_character_list}12345"
|
176
176
|
end
|
177
177
|
|
178
178
|
it "should be linked" do
|
179
|
-
@autolinked_text.should link_to_list_path(@
|
179
|
+
@autolinked_text.should link_to_list_path(@twentyfive_character_list)
|
180
180
|
end
|
181
181
|
end
|
182
182
|
end
|
data/spec/regex_spec.rb
CHANGED
@@ -34,11 +34,5 @@ describe "Twitter::Regex regular expressions" do
|
|
34
34
|
name.should match(Twitter::Regex[:list_name])
|
35
35
|
end
|
36
36
|
|
37
|
-
it "should match Japense names less than 25 characters" do
|
38
|
-
name = CGI.unescape("%E4%B9%97")
|
39
|
-
name.length.should < 25
|
40
|
-
name.should match(Twitter::Regex[:list_name])
|
41
|
-
end
|
42
|
-
|
43
37
|
end
|
44
38
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 7
|
10
|
+
version: 1.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Sanford
|
@@ -19,7 +19,7 @@ autorequire: ""
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-08-
|
22
|
+
date: 2010-08-19 00:00:00 -07:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|