simple-navigation 4.3.0 → 4.4.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/simple_navigation/item.rb +5 -4
- data/lib/simple_navigation/renderer/json.rb +2 -1
- data/lib/simple_navigation/version.rb +1 -1
- data/spec/simple_navigation/renderer/json_spec.rb +13 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e6c73b8c96a17a4730125ae741fc1f11f3c9495578cafdb2795223a251614c
|
4
|
+
data.tar.gz: 2b7e406ee541892f12e459eb2218a382f4f3ac26b89f11c382dfa92424146312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 252b910e666cd652c25bc42823c3366d4d7f88b541684d6123b4644bcb121657ea22b59415c8333ffa0e69eff6586f2bee75c754426899ab4b8895f9e66a2814
|
7
|
+
data.tar.gz: c4b8fa52310cda2c367e24e88c0366d49d6cbfff41443be5c50092445a80fe14f27f014df47e08e19b4c75cf8d55d55678e606df9a7f2866feb7ea6d1f2e7859
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,8 @@ module SimpleNavigation
|
|
5
5
|
attr_reader :key,
|
6
6
|
:name,
|
7
7
|
:sub_navigation,
|
8
|
-
:url
|
8
|
+
:url,
|
9
|
+
:options
|
9
10
|
|
10
11
|
# see ItemContainer#item
|
11
12
|
#
|
@@ -121,13 +122,13 @@ module SimpleNavigation
|
|
121
122
|
|
122
123
|
private
|
123
124
|
|
124
|
-
attr_accessor :container
|
125
|
-
:options
|
125
|
+
attr_accessor :container
|
126
126
|
|
127
127
|
attr_writer :key,
|
128
128
|
:name,
|
129
129
|
:sub_navigation,
|
130
|
-
:url
|
130
|
+
:url,
|
131
|
+
:options
|
131
132
|
|
132
133
|
def config
|
133
134
|
SimpleNavigation.config
|
@@ -20,12 +20,15 @@ module SimpleNavigation
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
# FIXME: not sure if :as_hash returning an array makes sense...
|
24
23
|
context 'when the :as_hash option is true' do
|
25
24
|
let(:options) {{ level: :all, as_hash: true }}
|
26
25
|
|
27
|
-
it 'returns a hash' do
|
26
|
+
it 'returns every item as a hash' do
|
28
27
|
expect(output).to be_an Array
|
28
|
+
|
29
|
+
output.each do |item|
|
30
|
+
expect(item).to be_an Hash
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
it 'renders the selected page' do
|
@@ -34,6 +37,14 @@ module SimpleNavigation
|
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
40
|
+
context 'with options' do
|
41
|
+
it 'should render options for each item' do
|
42
|
+
parsed_output.each do |item|
|
43
|
+
expect(item).to have_key('options')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
37
48
|
context 'when a sub navigation item is selected' do
|
38
49
|
let(:invoices_item) do
|
39
50
|
parsed_output.find { |item| item['name'] == 'Invoices' }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andi Schacke
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
262
|
+
rubygems_version: 3.2.3
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: simple-navigation is a ruby library for creating navigations (with multiple
|