twitter-text 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea9284103a22c002b069e541f57268537ff9322f
4
- data.tar.gz: 64dd335004f54948eb4f2b13c3c320dc259cf7e5
3
+ metadata.gz: 4dca6bf91ee40d1475bd65447e46f8e999f65ece
4
+ data.tar.gz: ba839959cc3dc3606d2ddb36ab02f9b49d8c7611
5
5
  SHA512:
6
- metadata.gz: 1fe3443ba9458afa51d8fb3237b69a45bc34957ea17c02aca29e7cb5d89e99ed6864a68e64b951b837007f272f0c4ccd159103153863ce42a71bdbf0e8264f90
7
- data.tar.gz: 2cf2f72de77fdeba40939ba591dee897e07c9e3ad54a93355cfd707f2a70e3f37ca41ede0ae03c06fa98364cbea6656ced6b7823dc7b1e492bcb8b43709f6983
6
+ metadata.gz: e8b9eaaf6afe97481cfc04e017a869d7265d65d5027280ecf263931d1081bc32201506e98a1b17c952940d64a18fae640d4041d161618c2807d5e8f4ec22ad48
7
+ data.tar.gz: 4d22ed49be6e5a815f3949693f7c1e6b73bb97eefa2395bcc39f9cfc17072a9ee4ad3b0732f5c954a20988c3e42e5ebd414357eff18d405bd0dee00b44f35de5
data/.travis.yml CHANGED
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
4
  - 1.9.3
5
+ - 2.0.0
@@ -187,7 +187,7 @@ module Twitter
187
187
  REGEXEN[:valid_subdomain] = /(?:(?:#{DOMAIN_VALID_CHARS}(?:[_-]|#{DOMAIN_VALID_CHARS})*)?#{DOMAIN_VALID_CHARS}\.)/io
188
188
  REGEXEN[:valid_domain_name] = /(?:(?:#{DOMAIN_VALID_CHARS}(?:[-]|#{DOMAIN_VALID_CHARS})*)?#{DOMAIN_VALID_CHARS}\.)/io
189
189
 
190
- REGEXEN[:valid_gTLD] = /(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-z]|$))/i
190
+ REGEXEN[:valid_gTLD] = /(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-z@]|$))/i
191
191
  REGEXEN[:valid_ccTLD] = %r{
192
192
  (?:
193
193
  (?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|
@@ -196,7 +196,7 @@ module Twitter
196
196
  lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|
197
197
  pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|
198
198
  th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)
199
- (?=[^0-9a-z]|$)
199
+ (?=[^0-9a-z@]|$)
200
200
  )
201
201
  }ix
202
202
  REGEXEN[:valid_punycode] = /(?:xn--[0-9a-z]+)/i
@@ -221,10 +221,26 @@ module Twitter
221
221
  REGEXEN[:valid_port_number] = /[0-9]+/
222
222
 
223
223
  REGEXEN[:valid_general_url_path_chars] = /[a-z0-9!\*';:=\+\,\.\$\/%#\[\]\-_~&|@#{LATIN_ACCENTS}]/io
224
- # Allow URL paths to contain balanced parens
224
+ # Allow URL paths to contain up to two nested levels of balanced parens
225
225
  # 1. Used in Wikipedia URLs like /Primer_(film)
226
226
  # 2. Used in IIS sessions like /S(dfd346)/
227
- REGEXEN[:valid_url_balanced_parens] = /\(#{REGEXEN[:valid_general_url_path_chars]}+\)/io
227
+ # 3. Used in Rdio URLs like /track/We_Up_(Album_Version_(Edited))/
228
+ REGEXEN[:valid_url_balanced_parens] = /
229
+ \(
230
+ (?:
231
+ #{REGEXEN[:valid_general_url_path_chars]}+
232
+ |
233
+ # allow one nested level of balanced parentheses
234
+ (?:
235
+ #{REGEXEN[:valid_general_url_path_chars]}*
236
+ \(
237
+ #{REGEXEN[:valid_general_url_path_chars]}+
238
+ \)
239
+ #{REGEXEN[:valid_general_url_path_chars]}*
240
+ )
241
+ )
242
+ \)
243
+ /iox
228
244
  # Valid end-of-path chracters (so /foo. does not gobble the period).
229
245
  # 1. Allow =&# for empty URL parameters and other URL-join artifacts
230
246
  REGEXEN[:valid_url_path_ending_chars] = /[a-z0-9=_#\/\+\-#{LATIN_ACCENTS}]|(?:#{REGEXEN[:valid_url_balanced_parens]})/io
@@ -249,7 +265,7 @@ module Twitter
249
265
  (\?#{REGEXEN[:valid_url_query_chars]}*#{REGEXEN[:valid_url_query_ending_chars]})? # $8 Query String
250
266
  )
251
267
  )
252
- }iox;
268
+ }iox
253
269
 
254
270
  REGEXEN[:cashtag] = /[a-z]{1,6}(?:[._][a-z]{1,2})?/i
255
271
  REGEXEN[:valid_cashtag] = /(^|#{REGEXEN[:spaces]})(\$)(#{REGEXEN[:cashtag]})(?=$|\s|[#{PUNCTUATION_CHARS}])/i
data/spec/spec_helper.rb CHANGED
@@ -9,6 +9,7 @@ end
9
9
  $:.push File.join(File.dirname(__FILE__), '..', 'lib')
10
10
 
11
11
  require 'nokogiri'
12
+ require 'json'
12
13
  require 'simplecov'
13
14
  SimpleCov.start do
14
15
  add_group 'Libraries', 'lib'
@@ -54,7 +54,7 @@ class ConformanceTest < Test::Unit::TestCase
54
54
  raise "No such test suite: #{test_type.to_s}" unless yaml["tests"][test_type.to_s]
55
55
 
56
56
  yaml["tests"][test_type.to_s].each do |test_info|
57
- name = :"test_#{test_type}_#{test_info['description']}"
57
+ name = :"test_#{test_type} #{test_info['description']}"
58
58
  define_method name do
59
59
  @test_info = test_info
60
60
  instance_eval(&block)
data/twitter-text.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "twitter-text"
5
- s.version = "1.6.3"
5
+ s.version = "1.6.4"
6
6
  s.authors = ["Matt Sanford", "Patrick Ewing", "Ben Cherry", "Britt Selvitelle",
7
7
  "Raffi Krikorian", "J.P. Cummins", "Yoshimasa Niwa", "Keita Fujii", "James Koval"]
8
8
  s.email = ["matt@twitter.com", "patrick.henry.ewing@gmail.com", "bcherry@gmail.com", "bs@brittspace.com",
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.summary = "Twitter text handling library"
17
17
 
18
18
  s.add_development_dependency "multi_json", "~> 1.3"
19
- s.add_development_dependency "nokogiri"
19
+ s.add_development_dependency "nokogiri", "~> 1.5.10"
20
20
  s.add_development_dependency "rake"
21
21
  s.add_development_dependency "rdoc"
22
22
  s.add_development_dependency "rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Sanford
@@ -16,104 +16,104 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2013-09-16 00:00:00.000000000 Z
19
+ date: 2013-11-13 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: multi_json
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.3'
28
28
  type: :development
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.3'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: nokogiri
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: 1.5.10
42
42
  type: :development
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: 1.5.10
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: rake
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: rdoc
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rspec
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: simplecov
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: unf
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ~>
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.1.0
112
112
  type: :runtime
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ~>
116
+ - - "~>"
117
117
  - !ruby/object:Gem::Version
118
118
  version: 0.1.0
119
119
  description: A gem that provides text handling for Twitter
@@ -131,11 +131,11 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - .gemtest
135
- - .gitignore
136
- - .gitmodules
137
- - .rspec
138
- - .travis.yml
134
+ - ".gemtest"
135
+ - ".gitignore"
136
+ - ".gitmodules"
137
+ - ".rspec"
138
+ - ".travis.yml"
139
139
  - Gemfile
140
140
  - LICENSE
141
141
  - README.rdoc
@@ -174,12 +174,12 @@ require_paths:
174
174
  - lib
175
175
  required_ruby_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - '>='
177
+ - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
- - - '>='
182
+ - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []