rails_autolink 1.1.4 → 1.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0d13b2069f253b2462d1ea876055e7d43897d5a
4
- data.tar.gz: add8c39f50d8e3632376e6eefca0d523fc528d83
3
+ metadata.gz: a9a91def4e38bcb28f15482c69da7024e299a19c
4
+ data.tar.gz: e987cc56142e5e1a882dfac7dd2aec775f3c68b4
5
5
  SHA512:
6
- metadata.gz: 919984fd569f0d131b296be468a718672947efeb8a1aee0887d7e0a9c5c32c5b4241db8d16585a41b945a15024e5edde050f89c5659742c5a10b207e53da1ca3
7
- data.tar.gz: 51ab4ad52e33448124dcf683472240d4c1ea0373ec03cd5d2ccee2c21014c3fd184897532547815f033ad831bb76e8adceb57679f684dd4ea606cf02f3f447df
6
+ metadata.gz: ec0d9d57552ac9d0198c4593265c6f8f68d5acc3398c136b1dc3c35228da77cb46c4025444d31a786159b5025514266ef220a98691a01a5e40c78fb19a959739
7
+ data.tar.gz: a5ece6112a62cf23086f764938ad2781a86ed25539fd0e2b7b8a978fd3b57d1b8d6c7214b2bceb2871574c722e33ce9005018af13235d23e2bce3d84ebcbbce8
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ Gemfile.lock
2
+ *.gem
3
+ *.rbc
4
+ .bundle
5
+ .config
6
+ coverage
7
+ InstalledFiles
8
+ lib/bundler/man
9
+ pkg
10
+ rdoc
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.1.5 / 2013-10-23
2
+
3
+ * Improved performance of email regex
4
+
5
+ * Protocol regex is case insensitive
6
+
1
7
  === 1.1.3 / 2013-09-12
2
8
 
3
9
  * Updates gemspec to work with latest rubygems
@@ -73,13 +73,13 @@ module RailsAutolink
73
73
  AUTO_LINK_RE = %r{
74
74
  (?: ((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs|file):)// | www\. )
75
75
  [^\s<\u00A0]+
76
- }x
76
+ }ix
77
77
 
78
78
  # regexps for determining context, used high-volume
79
79
  AUTO_LINK_CRE = [/<[^>]+$/, /^[^>]*>/, /<a\b.*?>/i, /<\/a>/i]
80
80
 
81
81
  AUTO_EMAIL_LOCAL_RE = /[\w.!#\$%&'*\/=?^`{|}~+-]/
82
- AUTO_EMAIL_RE = /[\w.!#\$%+-]\.?(?:#{AUTO_EMAIL_LOCAL_RE}+\.)*#{AUTO_EMAIL_LOCAL_RE}*@[\w-]+(?:\.[\w-]+)+/
82
+ AUTO_EMAIL_RE = /[\w.!#\$%+-]\.?#{AUTO_EMAIL_LOCAL_RE}*@[\w-]+(?:\.[\w-]+)+/
83
83
 
84
84
  BRACKETS = { ']' => '[', ')' => '(', '}' => '{' }
85
85
 
@@ -1,3 +1,3 @@
1
1
  module RailsAutolink
2
- VERSION = '1.1.4'
2
+ VERSION = '1.1.5'
3
3
  end
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.description = 'This is an extraction of the `auto_link` method from rails. The `auto_link` method was removed from Rails in version Rails 3.1. This gem is meant to bridge the gap for people migrating.'
12
12
 
13
13
  s.add_dependency 'rails', '> 3.1'
14
+ s.required_ruby_version = '>= 1.9.3'
14
15
  s.license = 'MIT'
15
16
 
16
17
  s.files = Dir.glob("{test,lib/**/*}") + `git ls-files -z`.split("\0")
@@ -138,7 +138,6 @@ class TestRailsAutolink < MiniTest::Unit::TestCase
138
138
  assert_equal linked_email, auto_link(linked_email)
139
139
  end
140
140
 
141
-
142
141
  def test_auto_link_at_eol
143
142
  url1 = "http://api.rubyonrails.com/Foo.html"
144
143
  url2 = "http://www.ruby-doc.org/core/Bar.html"
@@ -278,6 +277,9 @@ class TestRailsAutolink < MiniTest::Unit::TestCase
278
277
  link12_raw = 'http://tools.ietf.org/html/rfc3986'
279
278
  link12_result = generate_result(link12_raw)
280
279
  assert_equal %(<p>#{link12_result} text-after-nonbreaking-space</p>), auto_link("<p>#{link12_raw} text-after-nonbreaking-space</p>")
280
+
281
+ link13_raw = 'HTtP://www.rubyonrails.com'
282
+ assert_equal generate_result(link13_raw), auto_link(link13_raw)
281
283
  end
282
284
 
283
285
  def test_auto_link_parsing
@@ -309,6 +311,20 @@ class TestRailsAutolink < MiniTest::Unit::TestCase
309
311
  end
310
312
  end
311
313
 
314
+ def test_auto_link_does_not_timeout_when_parsing_odd_email_input
315
+ inputs = %w(
316
+ foo@...................................
317
+ foo@........................................
318
+ foo@.............................................
319
+ )
320
+
321
+ inputs.each do |input|
322
+ Timeout.timeout(0.2) do
323
+ assert_equal input, auto_link(input)
324
+ end
325
+ end
326
+ end
327
+
312
328
  private
313
329
  def generate_result(link_text, href = nil, escape = false)
314
330
  href ||= link_text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_autolink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-21 00:00:00.000000000 Z
13
+ date: 2013-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -38,9 +38,9 @@ files:
38
38
  - lib/rails_autolink/version.rb
39
39
  - lib/rails_autolink.rb
40
40
  - .autotest
41
+ - .gitignore
41
42
  - CHANGELOG.rdoc
42
43
  - Gemfile
43
- - Gemfile.lock
44
44
  - README.rdoc
45
45
  - Rakefile
46
46
  - rails_autolink.gemspec
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '>='
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: 1.9.3
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
63
  - - '>='
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project:
68
- rubygems_version: 2.1.2
68
+ rubygems_version: 2.1.5
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Automatic generation of html links in texts
data/Gemfile.lock DELETED
@@ -1,84 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- actionmailer (4.0.0.rc1)
5
- actionpack (= 4.0.0.rc1)
6
- mail (~> 2.5.3)
7
- actionpack (4.0.0.rc1)
8
- activesupport (= 4.0.0.rc1)
9
- builder (~> 3.1.0)
10
- erubis (~> 2.7.0)
11
- rack (~> 1.5.2)
12
- rack-test (~> 0.6.2)
13
- activemodel (4.0.0.rc1)
14
- activesupport (= 4.0.0.rc1)
15
- builder (~> 3.1.0)
16
- activerecord (4.0.0.rc1)
17
- activemodel (= 4.0.0.rc1)
18
- activerecord-deprecated_finders (~> 1.0.2)
19
- activesupport (= 4.0.0.rc1)
20
- arel (~> 4.0.0)
21
- activerecord-deprecated_finders (1.0.2)
22
- activesupport (4.0.0.rc1)
23
- i18n (~> 0.6, >= 0.6.4)
24
- minitest (~> 4.2)
25
- multi_json (~> 1.3)
26
- thread_safe (~> 0.1)
27
- tzinfo (~> 0.3.37)
28
- arel (4.0.0)
29
- atomic (1.1.8)
30
- builder (3.1.4)
31
- erubis (2.7.0)
32
- hike (1.2.2)
33
- i18n (0.6.4)
34
- mail (2.5.3)
35
- i18n (>= 0.4.0)
36
- mime-types (~> 1.16)
37
- treetop (~> 1.4.8)
38
- mime-types (1.23)
39
- minitest (4.7.4)
40
- multi_json (1.7.2)
41
- polyglot (0.3.3)
42
- rack (1.5.2)
43
- rack-test (0.6.2)
44
- rack (>= 1.0)
45
- rails (4.0.0.rc1)
46
- actionmailer (= 4.0.0.rc1)
47
- actionpack (= 4.0.0.rc1)
48
- activerecord (= 4.0.0.rc1)
49
- activesupport (= 4.0.0.rc1)
50
- bundler (>= 1.3.0, < 2.0)
51
- railties (= 4.0.0.rc1)
52
- sprockets-rails (~> 2.0.0.rc4)
53
- railties (4.0.0.rc1)
54
- actionpack (= 4.0.0.rc1)
55
- activesupport (= 4.0.0.rc1)
56
- rake (>= 0.8.7)
57
- thor (>= 0.18.1, < 2.0)
58
- rake (10.0.4)
59
- sprockets (2.9.3)
60
- hike (~> 1.2)
61
- multi_json (~> 1.0)
62
- rack (~> 1.0)
63
- tilt (~> 1.1, != 1.3.0)
64
- sprockets-rails (2.0.0.rc4)
65
- actionpack (>= 3.0)
66
- activesupport (>= 3.0)
67
- sprockets (~> 2.8)
68
- thor (0.18.1)
69
- thread_safe (0.1.0)
70
- atomic
71
- tilt (1.4.0)
72
- treetop (1.4.12)
73
- polyglot
74
- polyglot (>= 0.3.1)
75
- tzinfo (0.3.37)
76
-
77
- PLATFORMS
78
- ruby
79
-
80
- DEPENDENCIES
81
- arel
82
- minitest
83
- rack
84
- rails