navigator 5.1.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE.adoc +1 -1
- data/README.adoc +21 -21
- data/lib/navigator/identity.rb +1 -1
- data/lib/navigator/menu.rb +34 -12
- metadata +12 -222
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ee02c41b532e95fefe52fb97b3cf417280a700b11676c5c1de437b3db5e9a47
|
4
|
+
data.tar.gz: 95a01b5614e1b220f9f90d3841f4b92706230fde8a925542ccc19ff01eea1528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e94df980f74d11a7519d8c36b4a23b840a57d2473cae43213fd028f1748a3598545d5f2b2e39aea2dca0da60de830adf74b3fc775e2773ae17aca38a5f213f42
|
7
|
+
data.tar.gz: 7bd58c0e413a8f27b6af5391c573458f49a8b6a8c878e4fee3f8e0ed140fc0df5ae98c2d2c47e9b98ea309e5098c31197d338b6c44d227100d6df2c9549f841b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/LICENSE.adoc
CHANGED
@@ -150,7 +150,7 @@ additional liability.
|
|
150
150
|
|
151
151
|
END OF TERMS AND CONDITIONS
|
152
152
|
|
153
|
-
Copyright link:https://www.alchemists.io[
|
153
|
+
Copyright 2012 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
154
154
|
|
155
155
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
156
156
|
compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
|
data/README.adoc
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
[link=http://badge.fury.io/rb/navigator]
|
8
8
|
image::https://badge.fury.io/rb/navigator.svg[Gem Version]
|
9
|
+
[link=https://www.alchemists.io/projects/code_quality]
|
10
|
+
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
9
11
|
[link=https://circleci.com/gh/bkuhlmann/navigator]
|
10
12
|
image::https://circleci.com/gh/bkuhlmann/navigator.svg?style=svg[Circle CI Status]
|
11
13
|
|
@@ -48,13 +50,11 @@ used menu elements.
|
|
48
50
|
|
49
51
|
== Requirements
|
50
52
|
|
51
|
-
. https://www.ruby-lang.org[Ruby
|
52
|
-
.
|
53
|
+
. link:https://www.ruby-lang.org[Ruby]
|
54
|
+
. link:https://rubyonrails.org[Ruby on Rails]
|
53
55
|
|
54
56
|
== Setup
|
55
57
|
|
56
|
-
=== Production
|
57
|
-
|
58
58
|
To install, run:
|
59
59
|
|
60
60
|
....
|
@@ -67,22 +67,6 @@ Add the following to your Gemfile:
|
|
67
67
|
gem "navigator"
|
68
68
|
....
|
69
69
|
|
70
|
-
=== Development
|
71
|
-
|
72
|
-
To contribute, run:
|
73
|
-
|
74
|
-
....
|
75
|
-
git clone https://github.com/bkuhlmann/navigator.git
|
76
|
-
cd navigator
|
77
|
-
bin/setup
|
78
|
-
....
|
79
|
-
|
80
|
-
You can also use the IRB console for direct access to all objects:
|
81
|
-
|
82
|
-
....
|
83
|
-
bin/console
|
84
|
-
....
|
85
|
-
|
86
70
|
== Usage
|
87
71
|
|
88
72
|
The following are examples using the navigation view helper:
|
@@ -451,6 +435,22 @@ Assuming either the `Addresses` or `Emails` menu item was clicked, the `Profile`
|
|
451
435
|
would be active due to the regular expression (i.e. `/^profile.+/) matching one of the the
|
452
436
|
`profile/` paths.
|
453
437
|
|
438
|
+
== Development
|
439
|
+
|
440
|
+
To contribute, run:
|
441
|
+
|
442
|
+
....
|
443
|
+
git clone https://github.com/bkuhlmann/navigator.git
|
444
|
+
cd navigator
|
445
|
+
bin/setup
|
446
|
+
....
|
447
|
+
|
448
|
+
You can also use the IRB console for direct access to all objects:
|
449
|
+
|
450
|
+
....
|
451
|
+
bin/console
|
452
|
+
....
|
453
|
+
|
454
454
|
== Tests
|
455
455
|
|
456
456
|
To test, run:
|
@@ -495,4 +495,4 @@ Read link:CHANGES.adoc[CHANGES] for details.
|
|
495
495
|
|
496
496
|
== Credits
|
497
497
|
|
498
|
-
Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann
|
498
|
+
Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
data/lib/navigator/identity.rb
CHANGED
data/lib/navigator/menu.rb
CHANGED
@@ -3,11 +3,33 @@
|
|
3
3
|
module Navigator
|
4
4
|
# Renders a HTML menu.
|
5
5
|
class Menu
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
ALLOWED_ELEMENTS = /
|
7
|
+
^(
|
8
|
+
div|
|
9
|
+
section|
|
10
|
+
header|
|
11
|
+
h[1-6]|
|
12
|
+
nav|
|
13
|
+
ul|
|
14
|
+
li|
|
15
|
+
a|
|
16
|
+
img|
|
17
|
+
b|
|
18
|
+
em|
|
19
|
+
s|
|
20
|
+
small|
|
21
|
+
span|
|
22
|
+
strong|
|
23
|
+
sub|
|
24
|
+
sup|
|
25
|
+
form|
|
26
|
+
label|
|
27
|
+
select|
|
28
|
+
option|
|
29
|
+
input|
|
30
|
+
button
|
31
|
+
)$
|
32
|
+
/x
|
11
33
|
|
12
34
|
def initialize template,
|
13
35
|
tag: "ul",
|
@@ -19,12 +41,12 @@ module Navigator
|
|
19
41
|
@tag = Navigator::Tag.new tag, attributes: attributes, activator: activator
|
20
42
|
@menu_activator = activator
|
21
43
|
@items = []
|
22
|
-
instance_eval(&block) if
|
44
|
+
instance_eval(&block) if block
|
23
45
|
end
|
24
46
|
|
25
47
|
def add name, content = nil, attributes: {}, activator: menu_activator, &block
|
26
48
|
tag = Navigator::Tag.new name, content, attributes: attributes, activator: activator
|
27
|
-
return items << tag.render unless
|
49
|
+
return items << tag.render unless block
|
28
50
|
|
29
51
|
items << tag.prefix
|
30
52
|
items << tag.content
|
@@ -62,16 +84,16 @@ module Navigator
|
|
62
84
|
end
|
63
85
|
end
|
64
86
|
|
65
|
-
def method_missing name, *
|
87
|
+
def method_missing name, *positionals, **keywords, &block
|
66
88
|
if respond_to_missing? name
|
67
|
-
add(name, *
|
89
|
+
add(name, *positionals, **keywords, &block)
|
68
90
|
else
|
69
|
-
template.public_send(name, *
|
91
|
+
template.public_send(name, *positionals, **keywords) || super
|
70
92
|
end
|
71
93
|
end
|
72
94
|
|
73
95
|
def render
|
74
|
-
[tag.prefix, tag.content, items.compact.join
|
96
|
+
[tag.prefix, tag.content, items.compact.join, tag.suffix].compact.join
|
75
97
|
end
|
76
98
|
|
77
99
|
private
|
@@ -79,7 +101,7 @@ module Navigator
|
|
79
101
|
attr_accessor :template, :tag, :menu_activator, :items
|
80
102
|
|
81
103
|
def respond_to_missing? name, include_private = false
|
82
|
-
|
104
|
+
ALLOWED_ELEMENTS.match?(name) || super
|
83
105
|
end
|
84
106
|
|
85
107
|
def activate_item_attributes! attributes, url, activator
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navigator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
|
29
29
|
QWc=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2020-
|
31
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rails
|
@@ -45,230 +45,20 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '6.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: refinements
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0
|
54
|
-
type: :
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0.6'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: capybara
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '3.1'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '3.1'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: gemsmith
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '14.0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '14.0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: git-cop
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '4.0'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '4.0'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: guard-rspec
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '4.7'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '4.7'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: pg
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '1.2'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '1.2'
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: pry
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - "~>"
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '0.12'
|
138
|
-
type: :development
|
139
|
-
prerelease: false
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
141
|
-
requirements:
|
142
|
-
- - "~>"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '0.12'
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: pry-byebug
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - "~>"
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '3.7'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '3.7'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: rake
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '13.0'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '13.0'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: reek
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '6.0'
|
180
|
-
type: :development
|
181
|
-
prerelease: false
|
182
|
-
version_requirements: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '6.0'
|
187
|
-
- !ruby/object:Gem::Dependency
|
188
|
-
name: rspec-rails
|
189
|
-
requirement: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '4.0'
|
194
|
-
type: :development
|
195
|
-
prerelease: false
|
196
|
-
version_requirements: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '4.0'
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: rubocop
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '0.79'
|
208
|
-
type: :development
|
209
|
-
prerelease: false
|
210
|
-
version_requirements: !ruby/object:Gem::Requirement
|
211
|
-
requirements:
|
212
|
-
- - "~>"
|
213
|
-
- !ruby/object:Gem::Version
|
214
|
-
version: '0.79'
|
215
|
-
- !ruby/object:Gem::Dependency
|
216
|
-
name: rubocop-performance
|
217
|
-
requirement: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - "~>"
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: '1.5'
|
222
|
-
type: :development
|
223
|
-
prerelease: false
|
224
|
-
version_requirements: !ruby/object:Gem::Requirement
|
225
|
-
requirements:
|
226
|
-
- - "~>"
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version: '1.5'
|
229
|
-
- !ruby/object:Gem::Dependency
|
230
|
-
name: rubocop-rake
|
231
|
-
requirement: !ruby/object:Gem::Requirement
|
232
|
-
requirements:
|
233
|
-
- - "~>"
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
version: '0.5'
|
236
|
-
type: :development
|
237
|
-
prerelease: false
|
238
|
-
version_requirements: !ruby/object:Gem::Requirement
|
239
|
-
requirements:
|
240
|
-
- - "~>"
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
version: '0.5'
|
243
|
-
- !ruby/object:Gem::Dependency
|
244
|
-
name: rubocop-rspec
|
245
|
-
requirement: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - "~>"
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: '1.37'
|
250
|
-
type: :development
|
251
|
-
prerelease: false
|
252
|
-
version_requirements: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - "~>"
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: '1.37'
|
257
|
-
- !ruby/object:Gem::Dependency
|
258
|
-
name: simplecov
|
259
|
-
requirement: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - "~>"
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '0.18'
|
264
|
-
type: :development
|
53
|
+
version: '8.0'
|
54
|
+
type: :runtime
|
265
55
|
prerelease: false
|
266
56
|
version_requirements: !ruby/object:Gem::Requirement
|
267
57
|
requirements:
|
268
58
|
- - "~>"
|
269
59
|
- !ruby/object:Gem::Version
|
270
|
-
version: '0
|
271
|
-
description:
|
60
|
+
version: '8.0'
|
61
|
+
description:
|
272
62
|
email:
|
273
63
|
- brooke@alchemists.io
|
274
64
|
executables: []
|
@@ -294,7 +84,7 @@ metadata:
|
|
294
84
|
changelog_uri: https://www.alchemists.io/projects/navigator/changes.html
|
295
85
|
documentation_uri: https://www.alchemists.io/projects/navigator
|
296
86
|
source_code_uri: https://github.com/bkuhlmann/navigator
|
297
|
-
post_install_message:
|
87
|
+
post_install_message:
|
298
88
|
rdoc_options: []
|
299
89
|
require_paths:
|
300
90
|
- lib
|
@@ -302,15 +92,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
92
|
requirements:
|
303
93
|
- - "~>"
|
304
94
|
- !ruby/object:Gem::Version
|
305
|
-
version: '
|
95
|
+
version: '3.0'
|
306
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
97
|
requirements:
|
308
98
|
- - ">="
|
309
99
|
- !ruby/object:Gem::Version
|
310
100
|
version: '0'
|
311
101
|
requirements: []
|
312
|
-
rubygems_version: 3.
|
313
|
-
signing_key:
|
102
|
+
rubygems_version: 3.2.3
|
103
|
+
signing_key:
|
314
104
|
specification_version: 4
|
315
105
|
summary: Enhances Rails with a DSL for menu navigation.
|
316
106
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|