sape 0.1.0 → 0.1.1

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: 0c2d67179ee70b6f3a6568dd8d130c3ab4a06ef0
4
- data.tar.gz: 4f1ae458f853f5d95e237f2900db216ac30d95a5
3
+ metadata.gz: de0b6325493783f031e9d6a9a248917eda5a7af5
4
+ data.tar.gz: d9de9812d104864e8c9bb8ec9d538ab14be46c84
5
5
  SHA512:
6
- metadata.gz: 80685ecf3ef841bc28f0d0f0a711c219bfe1daeed7e2265f42edfb766de853ebf2fbbd743bbf5bc8775f4533731923cfac1a8a3f12e83a1d8a6ffe9f7a8be18a
7
- data.tar.gz: 2c8c4b45f1f073faf4bb12b5e685fc0b62daa77ccfb2c388176136b531d45cb71f4ea4d25232b30fee912968e6af130053b9ff088398beb3e1088683bc13adf1
6
+ metadata.gz: 399aa172b2b637fe0665fd5011c6b570f97923ad897a2ccd2558a0f767bd169abbd60dfe7a5230ec92c166e6def8a842032fd523eb5dcca222d9de61e2d002cf
7
+ data.tar.gz: 9289073db8e00ddaf2fb34c142cbb350ed356c98f1f51277ec3981c5fc27439483c3678e73378293ef12e5c5cae7573cca9f358423009354cb8aae9cf165a0e1
data/README.md CHANGED
@@ -37,6 +37,9 @@ Simply put helper call in desired place. Like this:
37
37
 
38
38
  <% # BLOCK LINKS %>
39
39
  <%= sape_links_block -%>
40
+
41
+ <% # CONTEXT LINKS %>
42
+ <%= sape_context_links text -%>
40
43
  ```
41
44
 
42
45
  #### Fetching links
@@ -1,6 +1,6 @@
1
1
  module SapeHelper
2
2
  def sape_links_block
3
- options = { links: SapeLink.where(page: request.original_fullpath, link_type: "simple") }
3
+ options = { links: SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "simple") }
4
4
  if SapeConfig.bot_ips.include?(request.remote_addr)
5
5
  options.merge!(check_code: SapeConfig.check_code)
6
6
  end
@@ -11,7 +11,7 @@ module SapeHelper
11
11
  end
12
12
 
13
13
  def sape_links
14
- links = SapeLink.where(page: request.original_fullpath, link_type: "simple").
14
+ links = SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "simple").
15
15
  pluck(:raw_link).
16
16
  join(SapeConfig.delimiter)
17
17
 
@@ -21,7 +21,7 @@ module SapeHelper
21
21
  end
22
22
 
23
23
  def sape_context_links(text)
24
- SapeLink.where(page: request.original_fullpath, link_type: "context").each do |link|
24
+ SapeLink.where(page: request.original_fullpath.chomp("/"), link_type: "context").each do |link|
25
25
  text.gsub!(link.anchor, link.raw_link)
26
26
  end
27
27
 
data/lib/sape/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sape
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Rodionov