obscura_linka 0.1.0 → 0.2.0
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 +4 -4
- data/lib/obscura_linka/version.rb +1 -1
- data/lib/obscura_linka.rb +7 -11
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cea738edb16422a0993b6e6f812a5fd07b1b7651
|
|
4
|
+
data.tar.gz: d1983368b391b240b533c407eb3fbc6b08855c13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b41b996dfa09615d7c384be1e5decd4ec766f706251df39a15d6d9c6bf0b353169b81b171c0fd3e6ea7ccdb9a19dee21b0c67e9f2b778ba814fbfcd3090f9405
|
|
7
|
+
data.tar.gz: 9e69c30f2d0edb7ba9dcc475b51adca5b03922518936cc770ee221c88930416f40348d003331a160f93843fa2a75b2f7a5ab36caf1ebdd250750b99eb5b0ac88
|
data/lib/obscura_linka.rb
CHANGED
|
@@ -15,25 +15,21 @@ module ActionView::Helpers::UrlHelper
|
|
|
15
15
|
|
|
16
16
|
url = options
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
if html_options
|
|
20
|
-
html_options = Hash[html_options]
|
|
21
|
-
else
|
|
22
|
-
html_options = {}
|
|
23
|
-
end
|
|
18
|
+
html_options ||= {}
|
|
24
19
|
|
|
25
20
|
# obfuscate the url
|
|
26
21
|
obfuscated_url = url.tr("A-Za-z", "N-ZA-Mn-za-m")
|
|
27
|
-
options = ""
|
|
28
|
-
# [[:data, {:href=>"asdf"}]]
|
|
29
|
-
# [[:data, {:href=>"asdf"}], [:class, "foobar"]]
|
|
30
22
|
|
|
31
23
|
html_options[:data] ||= {}
|
|
32
24
|
html_options[:data][:href] = obfuscated_url
|
|
33
25
|
html_options[:class] ||= ""
|
|
34
|
-
html_options[:class] << "rot13_link"
|
|
26
|
+
html_options[:class] << " rot13_link"
|
|
35
27
|
|
|
36
28
|
# put that obfuscated_url into a data attribute
|
|
37
|
-
|
|
29
|
+
if block_given?
|
|
30
|
+
link_to("", html_options, nil, &block)
|
|
31
|
+
else
|
|
32
|
+
link_to(name, "", html_options)
|
|
33
|
+
end
|
|
38
34
|
end
|
|
39
35
|
end
|
metadata
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: obscura_linka
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Austin Fonacier
|
|
8
8
|
- Kyle Boss
|
|
9
|
-
- Kunal
|
|
9
|
+
- Kunal Patel
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
@@ -45,6 +45,8 @@ description: Obscure links by creating and using link_to to move the rot13 the h
|
|
|
45
45
|
tell the browser to go to that link
|
|
46
46
|
email:
|
|
47
47
|
- austin@spokeo.com
|
|
48
|
+
- kboss@spokeo.com
|
|
49
|
+
- kpatel@spokeo.com
|
|
48
50
|
executables: []
|
|
49
51
|
extensions: []
|
|
50
52
|
extra_rdoc_files: []
|