gr_autolink 1.0.11 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/CHANGELOG.rdoc +9 -0
- data/Gemfile +3 -6
- data/Rakefile +9 -18
- data/gr_autolink.gemspec +41 -0
- data/lib/gr_autolink.rb +0 -2
- data/lib/gr_autolink/helpers.rb +21 -10
- data/lib/gr_autolink/version.rb +3 -0
- data/test/test_gr_autolink.rb +57 -8
- metadata +72 -50
- data/.gemtest +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2707768129fe2d6532822ff1ce6abcd9a72a1fd0
|
4
|
+
data.tar.gz: 25700284fffe52ac1ab67ac3a4724f5660acfc17
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 300627d7b18d355068ff11a3bb0c179c38d4b8a5e6d84d78b41b7e3797a094f844b4ce91ddc1f26c56e03c509282a82468fb8725d0cf2209fa9770872af94613
|
7
|
+
data.tar.gz: badb1913f9bdcfae0f1cb183bd0d85c88d36d5738ecc034d119886569ff0f27d0a18e66804402e3200bf14f84601e4a5f336715bbd8db4bc8c605b42d6056162
|
data/.gitignore
ADDED
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
=== 1.0.13 / 2014-03-26
|
2
|
+
|
3
|
+
* fix handling of img tags (again)
|
4
|
+
|
5
|
+
=== 1.0.12 / 2014-03-26
|
6
|
+
|
7
|
+
* merge changes in from rails_autolink
|
8
|
+
* fix handling of single-quotes
|
9
|
+
|
1
10
|
=== 1.0.11 / 2012-04-17
|
2
11
|
|
3
12
|
* adding ability to truncate the URL as link text to specified length
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,22 +1,13 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
require "bundler/gem_tasks"
|
2
4
|
|
3
|
-
require '
|
4
|
-
require 'hoe'
|
5
|
+
require 'rake/testtask'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Hoe.spec 'gr_autolink' do
|
12
|
-
developer('Aaron Patterson', 'aaron@tenderlovemaking.com')
|
13
|
-
developer('Juanjo Bazan', 'jjbazan@gmail.com')
|
14
|
-
developer('Akira Matsuda', 'ronnie@dio.jp')
|
15
|
-
developer('Brian Percival', 'bpercival@goodreads.com')
|
16
|
-
self.readme_file = 'README.rdoc'
|
17
|
-
self.history_file = 'CHANGELOG.rdoc'
|
18
|
-
self.extra_rdoc_files = FileList['*.rdoc']
|
19
|
-
self.extra_deps << ['rails', '~> 3.1']
|
7
|
+
Rake::TestTask.new do |t|
|
8
|
+
t.libs << 'lib/gr_autolink'
|
9
|
+
t.test_files = FileList['test/test*.rb']
|
10
|
+
t.verbose = true
|
20
11
|
end
|
21
12
|
|
22
|
-
|
13
|
+
task :default => :test
|
data/gr_autolink.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "gr_autolink/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "gr_autolink"
|
8
|
+
s.version = GrAutolink::VERSION
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.authors = ['Aaron Patterson', 'Juanjo Bazan', 'Akira Matsuda', 'Brian Percival', 'Jonathan Schatz']
|
11
|
+
s.email = ['aaron@tenderlovemaking.com', 'jjbazan@gmail.com', 'bpercival@goodreads.com', 'jon@divisionbyzero.com']
|
12
|
+
s.homepage = "https://github.com/goodreads/gr_autolink"
|
13
|
+
s.summary = %{Forked version of rails_autolink with new functionality}
|
14
|
+
s.description = <<-EOF
|
15
|
+
This is an adaptation of the extraction of the `auto_link` method from rails
|
16
|
+
that is the rails_autolink gem. The `auto_link`
|
17
|
+
method was removed from Rails in version Rails 3.1. This gem is meant to
|
18
|
+
bridge the gap for people migrating...and behaves a little differently from the
|
19
|
+
parent gem we forked from:
|
20
|
+
|
21
|
+
* performs html-escaping of characters such as '&' in strings that are getting
|
22
|
+
linkified if the incoming string is not html_safe?
|
23
|
+
* retains html-safety of incoming string (if input string is unsafe, will return
|
24
|
+
unsafe and vice versa)
|
25
|
+
* fixes at least one bug:
|
26
|
+
(<img src="http://some.u.rl"> => <img src="<a href="http://some.u.rl">http://some.u.rl</a>">)
|
27
|
+
though can't imagine this is intended behavior, also have trouble believing that
|
28
|
+
this was an open bug in rails...
|
29
|
+
EOF
|
30
|
+
s.rubyforge_project = "gr_autolink"
|
31
|
+
|
32
|
+
s.files = `git ls-files`.split("\n")
|
33
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
34
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
|
37
|
+
s.add_runtime_dependency "rails", '~> 3.1'
|
38
|
+
s.add_development_dependency "arel"
|
39
|
+
s.add_development_dependency "rack"
|
40
|
+
s.add_development_dependency "minitest"
|
41
|
+
end
|
data/lib/gr_autolink.rb
CHANGED
data/lib/gr_autolink/helpers.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
module GrAutolink
|
2
3
|
require 'active_support/core_ext/object/blank'
|
3
4
|
require 'active_support/core_ext/array/extract_options'
|
@@ -13,7 +14,7 @@ module GrAutolink
|
|
13
14
|
# <tt>:email_addresses</tt>, and <tt>:urls</tt>. If a block is given, each URL and
|
14
15
|
# e-mail address is yielded and the result is used as the link text. By default the
|
15
16
|
# text given is sanitized, you can override this behaviour setting the
|
16
|
-
# <tt>:sanitize</tt> option to false, or you can add options to the sanitization of
|
17
|
+
# <tt>:sanitize</tt> option to false, or you can add options to the sanitization of
|
17
18
|
# the text using the <tt>:sanitize_options</tt> option hash.
|
18
19
|
# An optional flag <tt>:max_link_length</tt> can be passed to let the function truncate
|
19
20
|
# the url text to the specified amount of characters
|
@@ -82,16 +83,22 @@ module GrAutolink
|
|
82
83
|
end
|
83
84
|
|
84
85
|
private
|
86
|
+
WORD_PATTERN = RUBY_VERSION < '1.9' ? '\w' : '\p{Word}'
|
87
|
+
|
88
|
+
PROTOCOLS = %w{ed2k ftp http https irc mailto news gopher nntp telnet
|
89
|
+
webcal xmpp callto feed svn urn aim rsync tag ssh sftp
|
90
|
+
rtsp afs file z39.50r chrome}.map{|p| Regexp.escape p}.join('|')
|
85
91
|
|
86
92
|
AUTO_LINK_RE = %r{
|
87
|
-
(?: (
|
88
|
-
[^\s
|
89
|
-
}
|
93
|
+
(?: ((?:view\-source\:)?(?:#{PROTOCOLS}):)// | www\. | [a-zA-Z0-9.]+[a-zA-Z0-9]\.[a-zA-Z0-9]{2,}\/)
|
94
|
+
[^\s<>\u00A0]+
|
95
|
+
}ix
|
90
96
|
|
91
97
|
# regexps for determining context, used high-volume
|
92
98
|
AUTO_LINK_CRE = [/<[^>]+$/, /^[^>]*>/, /<a\b.*?>/i, /<\/a>/i]
|
93
99
|
|
94
|
-
|
100
|
+
AUTO_EMAIL_LOCAL_RE = /[\w.!#\$%&'*\/=?^`{|}~+-]/
|
101
|
+
AUTO_EMAIL_RE = /[\w.!#\$%+-]\.?#{AUTO_EMAIL_LOCAL_RE}*@[\w-]+(?:\.[\w-]+)+/
|
95
102
|
|
96
103
|
BRACKETS = { ']' => '[', ')' => '(', '}' => '{' }
|
97
104
|
|
@@ -102,13 +109,12 @@ module GrAutolink
|
|
102
109
|
text.gsub(AUTO_LINK_RE) do
|
103
110
|
scheme, href = $1, $&
|
104
111
|
punctuation = []
|
105
|
-
|
106
112
|
if auto_linked?($`, $')
|
107
113
|
# do not change string; URL is already linked
|
108
114
|
href
|
109
115
|
else
|
110
116
|
# don't include trailing punctuation character as part of the URL
|
111
|
-
while href.sub!(/[
|
117
|
+
while href.sub!(/[^#{WORD_PATTERN}\/-]$/, '')
|
112
118
|
punctuation.push $&
|
113
119
|
if opening = BRACKETS[punctuation.last] and href.scan(opening).size > href.scan(punctuation.last).size
|
114
120
|
href << punctuation.pop
|
@@ -119,9 +125,8 @@ module GrAutolink
|
|
119
125
|
link_text = if block_given?
|
120
126
|
yield(href)
|
121
127
|
else
|
122
|
-
text.html_safe? ? href :
|
128
|
+
text.html_safe? ? href : escape(href)
|
123
129
|
end
|
124
|
-
|
125
130
|
href = 'http://' + href unless scheme
|
126
131
|
|
127
132
|
unless options[:sanitize] == false
|
@@ -130,7 +135,7 @@ module GrAutolink
|
|
130
135
|
end
|
131
136
|
|
132
137
|
unless text.html_safe?
|
133
|
-
href =
|
138
|
+
href = escape(href)
|
134
139
|
end
|
135
140
|
|
136
141
|
if options[:max_link_length]
|
@@ -142,6 +147,12 @@ module GrAutolink
|
|
142
147
|
end
|
143
148
|
end
|
144
149
|
|
150
|
+
def escape(href)
|
151
|
+
# escape_once doesn't escape single-quotes but we need to since we're
|
152
|
+
# potentially putting content in an attribute tag
|
153
|
+
escape_once(href).gsub("'", ''')
|
154
|
+
end
|
155
|
+
|
145
156
|
# Turns all email addresses into clickable links. If a block is given,
|
146
157
|
# each email is yielded and the result is used as the link text.
|
147
158
|
def auto_link_email_addresses(text, html_options = {}, options = {})
|
data/test/test_gr_autolink.rb
CHANGED
@@ -16,7 +16,7 @@ require 'action_dispatch/testing/assertions'
|
|
16
16
|
require 'action_view/helpers/text_helper'
|
17
17
|
require 'action_view/helpers/output_safety_helper'
|
18
18
|
|
19
|
-
class TestGrAutolink < MiniTest::
|
19
|
+
class TestGrAutolink < MiniTest::Test
|
20
20
|
include ActionView::Helpers::CaptureHelper
|
21
21
|
include ActionView::Helpers::TextHelper
|
22
22
|
include ActionView::Helpers::SanitizeHelper
|
@@ -25,12 +25,29 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
25
25
|
include ActionView::Helpers::OutputSafetyHelper
|
26
26
|
include ActionDispatch::Assertions::DomAssertions
|
27
27
|
|
28
|
+
def assert_dom_equal(expected, actual, message = "")
|
29
|
+
expected_dom = HTML::Document.new(expected).root
|
30
|
+
actual_dom = HTML::Document.new(actual).root
|
31
|
+
assert_equal expected_dom, actual_dom
|
32
|
+
end
|
33
|
+
|
34
|
+
def assert_dom_not_equal(expected, actual, message = "")
|
35
|
+
expected_dom = HTML::Document.new(expected).root
|
36
|
+
actual_dom = HTML::Document.new(actual).root
|
37
|
+
refute_equal expected_dom, actual_dom
|
38
|
+
end
|
39
|
+
|
28
40
|
def test_auto_link_within_tags
|
29
41
|
link_raw = 'http://www.rubyonrails.org/images/rails.png'
|
30
42
|
link_result = %Q(<img src="#{link_raw}" />)
|
31
43
|
assert_equal link_result, auto_link(link_result)
|
32
44
|
end
|
33
45
|
|
46
|
+
def test_auto_link_with_img_src
|
47
|
+
text = 'hello <img src="http://www.google.com/"> kitty'
|
48
|
+
assert_equal text, auto_link(text)
|
49
|
+
end
|
50
|
+
|
34
51
|
def test_auto_link_with_brackets
|
35
52
|
link1_raw = 'http://en.wikipedia.org/wiki/Sprite_(computer_graphics)'
|
36
53
|
link1_result = generate_result(link1_raw)
|
@@ -87,17 +104,17 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
87
104
|
assert_equal %{<a href="http://www.rubyonrails.com?id=1&num=2">http://www.rubyonrails.com?id=1&num=2</a>}, auto_link("#{link_raw}#{malicious_script}")
|
88
105
|
assert auto_link("#{link_raw}#{malicious_script}").html_safe?
|
89
106
|
end
|
90
|
-
|
107
|
+
|
91
108
|
def test_auto_link_should_sanitize_input_with_sanitize_options
|
92
109
|
link_raw = %{http://www.rubyonrails.com?id=1&num=2}
|
93
110
|
malicious_script = '<script>alert("malicious!")</script>'
|
94
111
|
text_with_attributes = %{<a href="http://ruby-lang-org" target="_blank" data-malicious="inject">Ruby</a>}
|
95
|
-
|
112
|
+
|
96
113
|
text_result = %{<a class="big" href="http://www.rubyonrails.com?id=1&num=2">http://www.rubyonrails.com?id=1&num=2</a><a href="http://ruby-lang-org" target="_blank">Ruby</a>}
|
97
114
|
assert_equal text_result, auto_link("#{link_raw}#{malicious_script}#{text_with_attributes}",
|
98
115
|
:sanitize_options => {:attributes => ["target", "href"]},
|
99
116
|
:html => {:class => 'big'})
|
100
|
-
|
117
|
+
|
101
118
|
assert auto_link("#{link_raw}#{malicious_script}#{text_with_attributes}",
|
102
119
|
:sanitize_options => {:attributes => ["target", "href"]},
|
103
120
|
:html => {:class => 'big'}).html_safe?
|
@@ -111,7 +128,7 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
111
128
|
def test_auto_link_should_not_sanitize_input_when_sanitize_option_is_false
|
112
129
|
link_raw = %{http://www.rubyonrails.com?id=1&num=2}
|
113
130
|
malicious_script = '<script>alert("malicious!")</script>'
|
114
|
-
|
131
|
+
|
115
132
|
assert_equal %{<a href="http://www.rubyonrails.com?id=1&num=2">http://www.rubyonrails.com?id=1&num=2</a><script>alert("malicious!")</script>}, auto_link("#{link_raw}#{malicious_script}", :sanitize => false)
|
116
133
|
assert !auto_link("#{link_raw}#{malicious_script}", :sanitize => false).html_safe?
|
117
134
|
end
|
@@ -159,14 +176,14 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
159
176
|
email_raw = 'santiago@wyeworks.com'
|
160
177
|
link_raw = 'http://www.rubyonrails.org'
|
161
178
|
malicious_script = '<script>alert("malicious!")</script>'
|
162
|
-
|
179
|
+
|
163
180
|
assert auto_link(nil).html_safe?, 'should be html safe'
|
164
181
|
assert auto_link('').html_safe?, 'should be html safe'
|
165
182
|
assert auto_link("#{link_raw} #{link_raw} #{link_raw}").html_safe?, 'should be html safe'
|
166
183
|
assert auto_link("hello #{email_raw}").html_safe?, 'should be html safe'
|
167
184
|
assert auto_link("hello #{email_raw} #{malicious_script}").html_safe?, 'should be html safe'
|
168
185
|
end
|
169
|
-
|
186
|
+
|
170
187
|
def test_auto_link_should_not_be_html_safe_when_sanitize_option_false
|
171
188
|
email_raw = 'santiago@wyeworks.com'
|
172
189
|
link_raw = 'http://www.rubyonrails.org'
|
@@ -176,6 +193,14 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
176
193
|
assert !auto_link("hello #{email_raw}", :sanitize => false).html_safe?, 'should not be html safe'
|
177
194
|
end
|
178
195
|
|
196
|
+
def test_auto_link_email_addres_with_especial_chars
|
197
|
+
email_raw = "and&re$la*+r-a.o'rea=l~ly@tenderlovemaking.com"
|
198
|
+
email_sanitized = "and&re$la*+r-a.o'rea=l~ly@tenderlovemaking.com"
|
199
|
+
email_result = %{<a href="mailto:#{email_raw}">#{email_sanitized}</a>}
|
200
|
+
assert_equal email_result, auto_link(email_raw)
|
201
|
+
assert !auto_link_email_addresses(email_result).html_safe?, 'should not be html safe'
|
202
|
+
end
|
203
|
+
|
179
204
|
def test_auto_link_email_address
|
180
205
|
email_raw = 'aaron@tenderlovemaking.com'
|
181
206
|
email_result = %{<a href="mailto:#{email_raw}">#{email_raw}</a>}
|
@@ -207,6 +232,8 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
207
232
|
email2_raw = '+david@loudthinking.com'
|
208
233
|
email2_result = %{<a href="mailto:#{email2_raw}">#{email2_raw}</a>}
|
209
234
|
assert_equal email2_result, auto_link(email2_raw)
|
235
|
+
assert_equal email2_result, auto_link(email2_raw, :all)
|
236
|
+
assert_equal email2_result, auto_link(email2_raw, :email_addresses)
|
210
237
|
|
211
238
|
email3_raw = '+david@loudthinking.com'
|
212
239
|
email3_result = %{<a href="mailto:+%64%61%76%69%64@%6c%6f%75%64%74%68%69%6e%6b%69%6e%67.%63%6f%6d">#{email3_raw}</a>}
|
@@ -278,6 +305,14 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
278
305
|
with_kcode 'u' do
|
279
306
|
assert_equal %(浅草.rbの公式サイトはこちら#{link11_result}), auto_link("浅草.rbの公式サイトはこちら#{link11_raw}")
|
280
307
|
end
|
308
|
+
|
309
|
+
link12_raw = 'http://tools.ietf.org/html/rfc3986'
|
310
|
+
link12_result = generate_result(link12_raw)
|
311
|
+
assert_equal %(<p>#{link12_result} text-after-nonbreaking-space</p>), auto_link("<p>#{link12_raw} text-after-nonbreaking-space</p>")
|
312
|
+
|
313
|
+
link13_raw = 'HTtP://www.rubyonrails.com'
|
314
|
+
assert_equal generate_result(link13_raw), auto_link(link13_raw)
|
315
|
+
|
281
316
|
end
|
282
317
|
|
283
318
|
def test_auto_link_parsing
|
@@ -301,6 +336,7 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
301
336
|
http://connect.oraclecorp.com/search?search[q]=green+france&search[type]=Group
|
302
337
|
http://of.openfoundry.org/projects/492/download#4th.Release.3
|
303
338
|
http://maps.google.co.uk/maps?f=q&q=the+london+eye&ie=UTF8&ll=51.503373,-0.11939&spn=0.007052,0.012767&z=16&iwloc=A
|
339
|
+
http://около.кола/колокола
|
304
340
|
bit.ly/asdf
|
305
341
|
)
|
306
342
|
|
@@ -329,7 +365,7 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
329
365
|
def test_auto_link_retains_non_html_safeness_on_strings_with_urls_to_autolink_sanitize_false
|
330
366
|
assert !auto_link("my link is http://123.abc.org", :sanitize => false).html_safe?
|
331
367
|
end
|
332
|
-
|
368
|
+
|
333
369
|
def test_auto_link_truncation_option
|
334
370
|
link_text = "http://www.a1234567890.com"
|
335
371
|
input = "my link needs truncation #{link_text} and so forth"
|
@@ -339,6 +375,19 @@ class TestGrAutolink < MiniTest::Unit::TestCase
|
|
339
375
|
assert auto_link(input, :max_link_length=>link_text.size+1) == expected_without_truncation
|
340
376
|
end
|
341
377
|
|
378
|
+
def test_auto_link_does_not_timeout_when_parsing_odd_email_input
|
379
|
+
inputs = %w(
|
380
|
+
foo@...................................
|
381
|
+
foo@........................................
|
382
|
+
foo@.............................................
|
383
|
+
) << "A" * 100000
|
384
|
+
inputs.each do |input|
|
385
|
+
Timeout.timeout(0.2) do
|
386
|
+
assert_equal input, auto_link(input)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
342
391
|
private
|
343
392
|
def generate_result(link_text, href = nil)
|
344
393
|
href ||= link_text
|
metadata
CHANGED
@@ -1,112 +1,134 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gr_autolink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.13
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Aaron Patterson
|
9
8
|
- Juanjo Bazan
|
10
9
|
- Akira Matsuda
|
11
10
|
- Brian Percival
|
11
|
+
- Jonathan Schatz
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
19
|
-
requirement:
|
20
|
-
none: false
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
21
20
|
requirements:
|
22
|
-
- - ~>
|
21
|
+
- - "~>"
|
23
22
|
- !ruby/object:Gem::Version
|
24
23
|
version: '3.1'
|
25
24
|
type: :runtime
|
26
25
|
prerelease: false
|
27
|
-
version_requirements:
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '3.1'
|
28
31
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
30
|
-
requirement:
|
31
|
-
none: false
|
32
|
+
name: arel
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
32
34
|
requirements:
|
33
|
-
- -
|
35
|
+
- - ">="
|
34
36
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
37
|
+
version: '0'
|
36
38
|
type: :development
|
37
39
|
prerelease: false
|
38
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
39
45
|
- !ruby/object:Gem::Dependency
|
40
|
-
name:
|
41
|
-
requirement:
|
42
|
-
none: false
|
46
|
+
name: rack
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
43
48
|
requirements:
|
44
|
-
- -
|
49
|
+
- - ">="
|
45
50
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
51
|
+
version: '0'
|
47
52
|
type: :development
|
48
53
|
prerelease: false
|
49
|
-
version_requirements:
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: minitest
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
description: |
|
74
|
+
This is an adaptation of the extraction of the `auto_link` method from rails
|
75
|
+
that is the rails_autolink gem. The `auto_link`
|
76
|
+
method was removed from Rails in version Rails 3.1. This gem is meant to
|
77
|
+
bridge the gap for people migrating...and behaves a little differently from the
|
78
|
+
parent gem we forked from:
|
79
|
+
|
80
|
+
* performs html-escaping of characters such as '&' in strings that are getting
|
81
|
+
linkified if the incoming string is not html_safe?
|
82
|
+
* retains html-safety of incoming string (if input string is unsafe, will return
|
83
|
+
unsafe and vice versa)
|
84
|
+
* fixes at least one bug:
|
85
|
+
(<img src="http://some.u.rl"> => <img src="<a href="http://some.u.rl">http://some.u.rl</a>">)
|
86
|
+
though can't imagine this is intended behavior, also have trouble believing that
|
87
|
+
this was an open bug in rails...
|
60
88
|
email:
|
61
89
|
- aaron@tenderlovemaking.com
|
62
90
|
- jjbazan@gmail.com
|
63
|
-
- ronnie@dio.jp
|
64
91
|
- bpercival@goodreads.com
|
92
|
+
- jon@divisionbyzero.com
|
65
93
|
executables: []
|
66
94
|
extensions: []
|
67
|
-
extra_rdoc_files:
|
68
|
-
- CHANGELOG.rdoc
|
69
|
-
- Manifest.txt
|
70
|
-
- README.rdoc
|
71
|
-
- TODO.txt
|
95
|
+
extra_rdoc_files: []
|
72
96
|
files:
|
73
|
-
- .autotest
|
97
|
+
- ".autotest"
|
98
|
+
- ".gitignore"
|
74
99
|
- CHANGELOG.rdoc
|
75
100
|
- Gemfile
|
76
101
|
- Manifest.txt
|
77
102
|
- README.rdoc
|
78
103
|
- Rakefile
|
104
|
+
- TODO.txt
|
105
|
+
- gr_autolink.gemspec
|
79
106
|
- lib/gr_autolink.rb
|
80
107
|
- lib/gr_autolink/helpers.rb
|
108
|
+
- lib/gr_autolink/version.rb
|
81
109
|
- test/test_gr_autolink.rb
|
82
|
-
|
83
|
-
- .gemtest
|
84
|
-
homepage: http://github.com/goodreads/gr_autolink
|
110
|
+
homepage: https://github.com/goodreads/gr_autolink
|
85
111
|
licenses: []
|
112
|
+
metadata: {}
|
86
113
|
post_install_message:
|
87
|
-
rdoc_options:
|
88
|
-
- --main
|
89
|
-
- README.rdoc
|
114
|
+
rdoc_options: []
|
90
115
|
require_paths:
|
91
116
|
- lib
|
92
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
118
|
requirements:
|
95
|
-
- -
|
119
|
+
- - ">="
|
96
120
|
- !ruby/object:Gem::Version
|
97
121
|
version: '0'
|
98
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
123
|
requirements:
|
101
|
-
- -
|
124
|
+
- - ">="
|
102
125
|
- !ruby/object:Gem::Version
|
103
126
|
version: '0'
|
104
127
|
requirements: []
|
105
128
|
rubyforge_project: gr_autolink
|
106
|
-
rubygems_version:
|
129
|
+
rubygems_version: 2.2.2
|
107
130
|
signing_key:
|
108
|
-
specification_version:
|
109
|
-
summary:
|
110
|
-
that is the rails_autolink gem
|
131
|
+
specification_version: 4
|
132
|
+
summary: Forked version of rails_autolink with new functionality
|
111
133
|
test_files:
|
112
134
|
- test/test_gr_autolink.rb
|
data/.gemtest
DELETED
File without changes
|