simple-navigation 4.3.0 → 4.4.1
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/.ruby-version +1 -0
- data/CHANGELOG.md +14 -5
- data/README.md +3 -5
- 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/simple-navigation.gemspec +1 -0
- data/spec/simple_navigation/renderer/json_spec.rb +13 -2
- metadata +18 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 928ca1b86e5df9d0d9e5d100b5490855a22d9eec7a9b6bf09e8d33b37a882574
|
|
4
|
+
data.tar.gz: 55827efb254fa331d2467e87b27ae3673e04489e3790b89470346022bbe7a77e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff9c68aa67a27d65cab0462b09893e3394e584f43f0c33be5abe40a6c80543ec0f4bf57fffa206d3ec9ba9a2ebc03a1750b19532f3e994652f5e2caeb715387a
|
|
7
|
+
data.tar.gz: 848213275482447b8017c576887eb7c5c9061ce3e5d54c2d57f2f0a1323c7b2c382979352c59cee3e0d024edc15947a967604af2107dbea51ecaa09ad991d5fa
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.4.1
|
|
4
|
+
|
|
5
|
+
* Removes the link to the online demo from the README. Credits to tosbourn.
|
|
6
|
+
* Adds ostruct as explicit runtime dep to silence warnings with ruby 3.4.x. Credits to SebouChu.
|
|
7
|
+
|
|
8
|
+
## 4.4.0
|
|
9
|
+
|
|
10
|
+
* Add options rendering to json renderer. Credits to Mikhail Kytyzov.
|
|
11
|
+
|
|
3
12
|
## 4.3.0
|
|
4
13
|
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
14
|
+
* Removed warnings from rspec. Thanks mgrunberg.
|
|
15
|
+
* Add compatibility with rails 6.1. Credits to mgrunberg.
|
|
16
|
+
* Run specs against 6.1. Credits to mgrunberg.
|
|
8
17
|
|
|
9
18
|
## 4.2.0
|
|
10
19
|
|
|
11
|
-
*
|
|
12
|
-
*
|
|
20
|
+
* Improvements to generator template. Credits to mgrunberg.
|
|
21
|
+
* Be able to run 'rake spec:rails-6-0-stable'. Credits to mgrunberg.
|
|
13
22
|
|
|
14
23
|
## 4.1.0
|
|
15
24
|
|
data/README.md
CHANGED
|
@@ -17,11 +17,9 @@ You can consult the project's RDoc on [RubyDoc.info](http://rubydoc.info/github/
|
|
|
17
17
|
|
|
18
18
|
If you need to generate the RDoc files locally, check out the repository and simply call the `rake rdoc` in the project's folder.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Demo
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
The source code of this online demo is [available on Github](http://github.com/codeplant/simple-navigation-demo).
|
|
22
|
+
Demo source code is [available on Github](http://github.com/codeplant/simple-navigation-demo).
|
|
25
23
|
|
|
26
24
|
## Feedback and Questions
|
|
27
25
|
|
|
@@ -60,4 +58,4 @@ In this situation `/Users/username/.rubies/ruby-2.2.3/bin/rake` is the command y
|
|
|
60
58
|
|
|
61
59
|
## License
|
|
62
60
|
|
|
63
|
-
Copyright (c)
|
|
61
|
+
Copyright (c) 2026 codeplant GmbH, released under the MIT license
|
|
@@ -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
|
data/simple-navigation.gemspec
CHANGED
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.rdoc_options = ['--inline-source', '--charset=UTF-8']
|
|
29
29
|
|
|
30
30
|
spec.add_runtime_dependency 'activesupport', '>= 2.3.2'
|
|
31
|
+
spec.add_runtime_dependency 'ostruct'
|
|
31
32
|
|
|
32
33
|
spec.add_development_dependency 'bundler'
|
|
33
34
|
spec.add_development_dependency 'capybara'
|
|
@@ -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,16 +1,15 @@
|
|
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andi Schacke
|
|
8
8
|
- Mark J. Titorenko
|
|
9
9
|
- Simon Courtois
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: activesupport
|
|
@@ -26,6 +25,20 @@ dependencies:
|
|
|
26
25
|
- - ">="
|
|
27
26
|
- !ruby/object:Gem::Version
|
|
28
27
|
version: 2.3.2
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: ostruct
|
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
- - ">="
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: '0'
|
|
35
|
+
type: :runtime
|
|
36
|
+
prerelease: false
|
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '0'
|
|
29
42
|
- !ruby/object:Gem::Dependency
|
|
30
43
|
name: bundler
|
|
31
44
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -164,6 +177,7 @@ extra_rdoc_files: []
|
|
|
164
177
|
files:
|
|
165
178
|
- ".gitignore"
|
|
166
179
|
- ".rspec"
|
|
180
|
+
- ".ruby-version"
|
|
167
181
|
- ".travis.yml"
|
|
168
182
|
- CHANGELOG.md
|
|
169
183
|
- Gemfile
|
|
@@ -242,7 +256,6 @@ homepage: http://github.com/codeplant/simple-navigation
|
|
|
242
256
|
licenses:
|
|
243
257
|
- MIT
|
|
244
258
|
metadata: {}
|
|
245
|
-
post_install_message:
|
|
246
259
|
rdoc_options:
|
|
247
260
|
- "--inline-source"
|
|
248
261
|
- "--charset=UTF-8"
|
|
@@ -259,8 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
259
272
|
- !ruby/object:Gem::Version
|
|
260
273
|
version: '0'
|
|
261
274
|
requirements: []
|
|
262
|
-
rubygems_version: 3.
|
|
263
|
-
signing_key:
|
|
275
|
+
rubygems_version: 3.6.7
|
|
264
276
|
specification_version: 4
|
|
265
277
|
summary: simple-navigation is a ruby library for creating navigations (with multiple
|
|
266
278
|
levels) for your Rails, Sinatra or Padrino application.
|