twitter-text 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
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.6"
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"
@@ -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] = /^[a-zA-Z\u0080-\u00ff].{0,79}$/
36
+ REGEXEN[:list_name] = /[a-zA-Z][a-zA-Z0-9_\-\u0080-\u00ff]{0,24}/
37
37
  else
38
- REGEXEN[:list_name] = /^[a-zA-Z\x80-\xff].{0,79}$/
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})(\/[a-zA-Z][a-zA-Z0-9\u0080-\u00ff\-]{0,79})?/
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
@@ -171,12 +171,12 @@ describe Twitter::Autolink do
171
171
 
172
172
  context "username over twenty characters" do
173
173
  def original_text
174
- @eighty_character_list = "jack/" + ("a" * 80)
175
- "@#{@eighty_character_list}12345"
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(@eighty_character_list)
179
+ @autolinked_text.should link_to_list_path(@twentyfive_character_list)
180
180
  end
181
181
  end
182
182
  end
@@ -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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 6
10
- version: 1.1.6
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-10 00:00:00 -07:00
22
+ date: 2010-08-19 00:00:00 -07:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency