dejan-auto_html 1.1.1 → 1.1.2
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/CHANGELOG.rdoc +4 -0
- data/VERSION.yml +1 -1
- data/auto_html.gemspec +4 -4
- data/lib/auto_html/filters/link.rb +1 -1
- data/test/unit/filters/link_test.rb +17 -2
- metadata +5 -4
data/CHANGELOG.rdoc
CHANGED
data/VERSION.yml
CHANGED
data/auto_html.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{auto_html}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dejan Simic"]
|
12
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-24}
|
13
13
|
s.description = %q{Automatically transforms urls (via domain) and includes the destination resource (Vimeo, YouTube movie, image, ...) in your document}
|
14
14
|
s.email = %q{desimic@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
|
|
55
55
|
s.homepage = %q{http://github.com/dejan/auto_html}
|
56
56
|
s.rdoc_options = ["--charset=UTF-8"]
|
57
57
|
s.require_paths = ["lib"]
|
58
|
-
s.rubygems_version = %q{1.3.
|
58
|
+
s.rubygems_version = %q{1.3.5}
|
59
59
|
s.summary = %q{Automatically transforms urls (via domain) and includes the destination resource (Vimeo, YouTube movie, image, ...) in your document}
|
60
60
|
s.test_files = [
|
61
61
|
"test/fixture_setup.rb",
|
@@ -76,7 +76,7 @@ Gem::Specification.new do |s|
|
|
76
76
|
|
77
77
|
if s.respond_to? :specification_version then
|
78
78
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
79
|
-
s.specification_version =
|
79
|
+
s.specification_version = 3
|
80
80
|
|
81
81
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
82
82
|
else
|
@@ -28,7 +28,7 @@ AutoHtml.add_filter(:link).with({}) do |text, options|
|
|
28
28
|
(?:\.[-\w]+)* # remaining subdomains or domain
|
29
29
|
(?::\d+)? # port
|
30
30
|
(?:/(?:[~\w\+@%=\(\)-]|(?:[,.;:'][^\s$]))*)* # path
|
31
|
-
(
|
31
|
+
(?:[\?|\#][\w\+@%&=.;:-]+)? # query string
|
32
32
|
(?:\#[\w\-]*)? # trailing anchor
|
33
33
|
)
|
34
34
|
([[:punct:]]|<|$|) # trailing text
|
@@ -6,12 +6,27 @@ class LinkTest < Test::Unit::TestCase
|
|
6
6
|
result = auto_html("http://vukajlija.com") { link }
|
7
7
|
assert_equal '<a href="http://vukajlija.com">http://vukajlija.com</a>', result
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
|
+
def test_transform_with_param
|
11
|
+
result = auto_html('http://google.com/abc?query=ruby') { link }
|
12
|
+
assert_equal '<a href="http://google.com/abc?query=ruby">http://google.com/abc?query=ruby</a>', result
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_transform_with_params
|
16
|
+
result = auto_html('http://www.youtube.com/watch?v=s5C5Zk4kobo&feature=related') { link }
|
17
|
+
assert_equal '<a href="http://www.youtube.com/watch?v=s5C5Zk4kobo&feature=related">http://www.youtube.com/watch?v=s5C5Zk4kobo&feature=related</a>', result
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_transform_with_commas
|
21
|
+
result = auto_html('http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf') { link }
|
22
|
+
assert_equal '<a href="http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf">http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf</a>', result
|
23
|
+
end
|
24
|
+
|
10
25
|
def test_transform_complex_url
|
11
26
|
result = auto_html("http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0") { link }
|
12
27
|
assert_equal '<a href="http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0">http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0</a>', result
|
13
28
|
end
|
14
|
-
|
29
|
+
|
15
30
|
def test_transform_with_options
|
16
31
|
result = auto_html("http://rors.org") { link :rel => "nofollow", :target => "_blank" }
|
17
32
|
assert_equal '<a href="http://rors.org" rel="nofollow" target="_blank">http://rors.org</a>', result
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dejan-auto_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dejan Simic
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-24 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- test/unit/unit_test_helper.rb
|
60
60
|
has_rdoc: false
|
61
61
|
homepage: http://github.com/dejan/auto_html
|
62
|
+
licenses:
|
62
63
|
post_install_message:
|
63
64
|
rdoc_options:
|
64
65
|
- --charset=UTF-8
|
@@ -79,9 +80,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
80
|
requirements: []
|
80
81
|
|
81
82
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.3.5
|
83
84
|
signing_key:
|
84
|
-
specification_version:
|
85
|
+
specification_version: 3
|
85
86
|
summary: Automatically transforms urls (via domain) and includes the destination resource (Vimeo, YouTube movie, image, ...) in your document
|
86
87
|
test_files:
|
87
88
|
- test/fixture_setup.rb
|