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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de0b6325493783f031e9d6a9a248917eda5a7af5
4
- data.tar.gz: d9de9812d104864e8c9bb8ec9d538ab14be46c84
3
+ metadata.gz: 61dd2c2de5d5a03e5c3378c9eb5f86b41aec3822
4
+ data.tar.gz: df9adba5eb820a47d557760acd33d75256cc2335
5
5
  SHA512:
6
- metadata.gz: 399aa172b2b637fe0665fd5011c6b570f97923ad897a2ccd2558a0f767bd169abbd60dfe7a5230ec92c166e6def8a842032fd523eb5dcca222d9de61e2d002cf
7
- data.tar.gz: 9289073db8e00ddaf2fb34c142cbb350ed356c98f1f51277ec3981c5fc27439483c3678e73378293ef12e5c5cae7573cca9f358423009354cb8aae9cf165a0e1
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/iRet/sape)
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
- options = { links: SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "simple") }
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
- links = SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "simple").
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
- SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "context").each do |link|
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
@@ -1,3 +1,3 @@
1
1
  module Sape
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Rodionov