obscura_linka 0.1.0 → 0.2.0

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: 4979079112e02ac77b5e6fe6e4feb7d0cf881751
4
- data.tar.gz: 0fd6b44de0acdadeb8f9d09578a397e8818de872
3
+ metadata.gz: cea738edb16422a0993b6e6f812a5fd07b1b7651
4
+ data.tar.gz: d1983368b391b240b533c407eb3fbc6b08855c13
5
5
  SHA512:
6
- metadata.gz: 2cab90fc7541d29d8ca672d55c59006ea68e374d142c9d9e2a255413c4b5f2875d09f5cd3911549197dfdce16c642c41b1a246e72ff9696cff0e5d35ffed8f9e
7
- data.tar.gz: 1c85b0adf4df3dce6771cc14449170f511b44b12a0d61cb1f72ca55cfdd0d03af5d06ef2b0ea2f44a968fcb504fc9524fda5495b71541ff5fb2866a0f5642cac
6
+ metadata.gz: b41b996dfa09615d7c384be1e5decd4ec766f706251df39a15d6d9c6bf0b353169b81b171c0fd3e6ea7ccdb9a19dee21b0c67e9f2b778ba814fbfcd3090f9405
7
+ data.tar.gz: 9e69c30f2d0edb7ba9dcc475b51adca5b03922518936cc770ee221c88930416f40348d003331a160f93843fa2a75b2f7a5ab36caf1ebdd250750b99eb5b0ac88
@@ -1,3 +1,3 @@
1
1
  module ObscuraLinka
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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
- link_to(name, options, html_options, &block)
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Fonacier
8
8
  - Kyle Boss
9
- - Kunal Agrawal
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: []