sape 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/app/helpers/sape_helper.rb +6 -3
- data/lib/sape/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61dd2c2de5d5a03e5c3378c9eb5f86b41aec3822
|
4
|
+
data.tar.gz: df9adba5eb820a47d557760acd33d75256cc2335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e40dc2d6a048dbf70e71636afc13bc3a02e28eaa295b0590214edff5068d8ff4877b5c170c047819e64b0f0c869b284a909744a7c22799a6ce3ea2833a002162
|
7
|
+
data.tar.gz: 2eee9d46164326a3abd4ceb847eee2bcab89afcde0955e4a80d648417e9f7cc8aef296823fd4e0f45308beb0c273da824d53f074bc05d7b30be9bfc15a240ce0
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##Sape gem for Ruby On Rails
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/sape.png)](http://badge.fury.io/rb/sape)
|
4
|
-
[![Build Status](https://travis-ci.org/krim/sape.svg?branch=master)](https://travis-ci.org/
|
4
|
+
[![Build Status](https://travis-ci.org/krim/sape.svg?branch=master)](https://travis-ci.org/krim/sape)
|
5
5
|
|
6
6
|
###Rewritten from scratch
|
7
7
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module SapeHelper
|
2
2
|
def sape_links_block
|
3
|
-
|
3
|
+
request.original_fullpath.chomp!("/") if request.original_fullpath.last == "/" && request.original_fullpath != '/'
|
4
|
+
options = { links: SapeLink.where(page: request.original_fullpath, link_type: "simple") }
|
4
5
|
if SapeConfig.bot_ips.include?(request.remote_addr)
|
5
6
|
options.merge!(check_code: SapeConfig.check_code)
|
6
7
|
end
|
@@ -11,7 +12,8 @@ module SapeHelper
|
|
11
12
|
end
|
12
13
|
|
13
14
|
def sape_links
|
14
|
-
|
15
|
+
request.original_fullpath.chomp!("/") if request.original_fullpath.last == "/" && request.original_fullpath != '/'
|
16
|
+
links = SapeLink.where(page: request.original_fullpath, link_type: "simple").
|
15
17
|
pluck(:raw_link).
|
16
18
|
join(SapeConfig.delimiter)
|
17
19
|
|
@@ -21,7 +23,8 @@ module SapeHelper
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def sape_context_links(text)
|
24
|
-
|
26
|
+
request.original_fullpath.chomp!("/") if request.original_fullpath.last == "/" && request.original_fullpath != '/'
|
27
|
+
SapeLink.where(page: request.original_fullpath, link_type: "context").each do |link|
|
25
28
|
text.gsub!(link.anchor, link.raw_link)
|
26
29
|
end
|
27
30
|
|
data/lib/sape/version.rb
CHANGED