simpler_navigation 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 626e64edbed0821098ffb7e9f41ea482af4c902d6cfd1390d57c307906aaced8
4
- data.tar.gz: 4c3ee2f62d975d7cc1c4d6c1de00650479e2acf0bad15f492b92f19e5f2e66df
3
+ metadata.gz: 898421e7c748a8dd8c8f9f72ae5d37b358c91b66603b9e2691e0681f10e1b496
4
+ data.tar.gz: 9bdc4a5b4d05f8d7cf9c082eca9b1e7064a348a4744439c3961d0ef8f46faa17
5
5
  SHA512:
6
- metadata.gz: bd5187bbfa35c31aff30a0440b4f61edc3fe579cd98e791baacfada451802ed412eb781f063e8582e74686fe24155cd6dae1a59706c1361c3af6cec8244ca84c
7
- data.tar.gz: 158cdb352ec4541741babcc8684106115a5915a33693af17dcf8670e65ad096adcec4f98fe329183e536cc32c97413f48c3398652c1edce997acaa8fc3496e1f
6
+ metadata.gz: 558244e08471d58117e363d2bcd65b449692a28a7114f070d2fd1b0388f124b4b50b48d4b567ae6b1640a580f7ca19b19fdf016a687e7fa3c307b9ffc5326b65
7
+ data.tar.gz: ea12d233decd28eefba17be1bf82b7d7af7b9656b5c5f6b01ff932a233dbbe831103fde538f394817beb4a65599fa4035cf0a44f46523601bb4ab83d5f42acf0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simpler_navigation (0.1.3)
4
+ simpler_navigation (0.1.4)
5
5
  actionview
6
6
  railties
7
7
 
@@ -16,6 +16,11 @@ module SimplerNavigation
16
16
  @item = item
17
17
  @options = options
18
18
 
19
+ @request_fullpath = context.request.fullpath
20
+ if @options[:request_fullpath]
21
+ @request_fullpath = @options[:request_fullpath]
22
+ end
23
+
19
24
  if @item.nil?
20
25
  case @options[:level]
21
26
  when :all
@@ -112,14 +117,12 @@ module SimplerNavigation
112
117
  selected = false
113
118
  case item.options[:highlights_on]
114
119
  when Regexp
115
- selected = item.options[:highlights_on].match?(SimplerNavigation.request_fullpath)
120
+ selected = item.options[:highlights_on].match?(@request_fullpath)
116
121
  when Proc
117
122
  selected = item.options[:highlights_on].call
118
123
  else
119
- if SimplerNavigation.request_fullpath
120
- item_url_path = url_path(item.url).downcase
121
- selected = SimplerNavigation.request_fullpath.downcase.start_with?(item_url_path)
122
- end
124
+ item_url_path = url_path(item.url).downcase
125
+ selected = @request_fullpath.downcase.start_with?(item_url_path)
123
126
  end
124
127
 
125
128
  selected ||= item.children.any? do |key, value|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimplerNavigation
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
@@ -12,6 +12,5 @@ module SimplerNavigation
12
12
 
13
13
  class << self
14
14
  attr_accessor :config
15
- attr_accessor :request_fullpath
16
15
  end
17
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpler_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Muerdter