simpler_navigation 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 509f0fdc64cd8638e26bcc71ab8fb8c134f03c618daf10ab0dcc02c155441092
4
- data.tar.gz: d6ec22dfb537838f47613af757b76fcd0e1a435bc2be5608b1cbb97b0d416201
3
+ metadata.gz: 626e64edbed0821098ffb7e9f41ea482af4c902d6cfd1390d57c307906aaced8
4
+ data.tar.gz: 4c3ee2f62d975d7cc1c4d6c1de00650479e2acf0bad15f492b92f19e5f2e66df
5
5
  SHA512:
6
- metadata.gz: c3ec60011be01edfa57b1ccee86f65baa8452d324a8f1ed0246ecb64524852565aa734689d8bd4812edf285e86db223db70f202d8e68743fb8d3f8db57bf01a5
7
- data.tar.gz: 99e7ca7469f9e534a018fad100b790bd5671b957bf30d13f2c00a842367b77cf3bb7d5db300d20096015c647afb95656f4d54fd1f27afc06455a90f45e975544
6
+ metadata.gz: bd5187bbfa35c31aff30a0440b4f61edc3fe579cd98e791baacfada451802ed412eb781f063e8582e74686fe24155cd6dae1a59706c1361c3af6cec8244ca84c
7
+ data.tar.gz: 158cdb352ec4541741babcc8684106115a5915a33693af17dcf8670e65ad096adcec4f98fe329183e536cc32c97413f48c3398652c1edce997acaa8fc3496e1f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simpler_navigation (0.1.1)
4
+ simpler_navigation (0.1.3)
5
5
  actionview
6
6
  railties
7
7
 
@@ -66,6 +66,9 @@ module SimplerNavigation
66
66
  classes << SimplerNavigation.config.selected_class
67
67
  end
68
68
  options[:class] = classes.compact.join(" ")
69
+ if options[:class].empty?
70
+ options.delete(:class)
71
+ end
69
72
 
70
73
  options
71
74
  end
@@ -88,6 +91,9 @@ module SimplerNavigation
88
91
  classes << SimplerNavigation.config.active_leaf_class
89
92
  end
90
93
  options[:class] = classes.compact.join(" ")
94
+ if options[:class].empty?
95
+ options.delete(:class)
96
+ end
91
97
 
92
98
  options
93
99
  end
@@ -114,10 +120,10 @@ module SimplerNavigation
114
120
  item_url_path = url_path(item.url).downcase
115
121
  selected = SimplerNavigation.request_fullpath.downcase.start_with?(item_url_path)
116
122
  end
123
+ end
117
124
 
118
- selected ||= item.children.any? do |key, value|
119
- selected?(value)
120
- end
125
+ selected ||= item.children.any? do |key, value|
126
+ selected?(value)
121
127
  end
122
128
 
123
129
  @selected[item] = selected
@@ -141,23 +147,9 @@ module SimplerNavigation
141
147
 
142
148
  show = true
143
149
  if !item.options[:if].nil?
144
- show = case item.options[:if]
145
- when false
146
- false
147
- when true
148
- true
149
- else
150
- item.options[:if].call
151
- end
150
+ show = item.options[:if].call
152
151
  elsif !item.options[:unless].nil?
153
- show = case item.options[:unless]
154
- when false
155
- true
156
- when true
157
- false
158
- else
159
- !item.options[:unless].call
160
- end
152
+ show = !item.options[:unless].call
161
153
  end
162
154
 
163
155
  @show[item] = show
@@ -33,6 +33,13 @@ module SimplerNavigation
33
33
 
34
34
  tags
35
35
  end
36
+
37
+ def link_tag_options(item)
38
+ options = super
39
+ options.delete(:class)
40
+
41
+ options
42
+ end
36
43
  end
37
44
  end
38
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimplerNavigation
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Muerdter