navigator 5.2.0 → 6.0.1

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: 4cb2486689d1549cb94c1969ef760b88f481040f8b2855ae4397f141c9599d90
4
- data.tar.gz: d16f75595a7ada8161d13afcf5e89fe65f81f1f8d9d33f46f37932d7843202fe
3
+ metadata.gz: 25a2f4f3ef9f27b8cf03f18b2d0d8e176f3bbeafa0df67e0ef2da3675641dd88
4
+ data.tar.gz: 8dc20a09a9e923b3c60df70b76185d12c94754f13a44ca2d8c689b3a5dd35edd
5
5
  SHA512:
6
- metadata.gz: f86cfd94a880d76f7fbd22562f68404a95acd5024d18b889bcf64de17db79f9c984a5d81d926962a5ec13efe67c1ee79144a4220c38746cb2c8a1b675a882fc5
7
- data.tar.gz: ad0864289c48bebf564d32dae0d9e92996a0481f018a687d4a4ab4dd0a3a970920146bf518a2d7a7f7e005c7b94d7bc4373e0b2415908d9979eb3540ba2efedb
6
+ metadata.gz: 17d0b85f1a03e23309992078a678049d57c0c686b8a9ce39b0e51ef0dff253b2cfc395f152ee35710dadb1e5262b26430afdb2554944d0a67499ae4960f1b133
7
+ data.tar.gz: 4b06baa74a5f0ea096f423ea48c46270b69af9cf736448e42b9a12058f0cf5694166b2c0d8fcb16d9dcd8061baaf38e7fef9c61d6bf6797535a008512d073067
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[Alchemists].
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
 
@@ -53,8 +55,6 @@ used menu elements.
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:
@@ -5,7 +5,7 @@ module Navigator
5
5
  module Identity
6
6
  NAME = "navigator"
7
7
  LABEL = "Navigator"
8
- VERSION = "5.2.0"
8
+ VERSION = "6.0.1"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  end
11
11
  end
@@ -3,11 +3,33 @@
3
3
  module Navigator
4
4
  # Renders a HTML menu.
5
5
  class Menu
6
- # rubocop:disable Layout/LineLength
7
- def self.allowed_methods
8
- /^(div|section|header|h[1-6]|nav|ul|li|a|img|b|em|s|small|span|strong|sub|sup|form|label|select|option|input|button)$/
9
- end
10
- # rubocop:enable Layout/LineLength
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 block_given?
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 block_given?
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, *args, &block
87
+ def method_missing name, *positionals, **keywords, &block
66
88
  if respond_to_missing? name
67
- add(name, *args, &block)
89
+ add(name, *positionals, **keywords, &block)
68
90
  else
69
- template.public_send(name, *args) || super
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(""), tag.suffix].compact * ""
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
- self.class.allowed_methods.match?(name) || super
104
+ ALLOWED_ELEMENTS.match?(name) || super
83
105
  end
84
106
 
85
107
  def activate_item_attributes! attributes, url, activator
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navigator
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
- NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
13
+ MIIC/jCCAeagAwIBAgIBBDANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
+ a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMTAzMTkxMjQ4MDZaFw0yMjAzMTkx
15
+ MjQ4MDZaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
16
16
  IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
17
17
  xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
18
18
  brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
@@ -20,15 +20,15 @@ cert_chain:
20
20
  D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
21
21
  3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
22
22
  AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
23
- 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAIHhAlD3po4sTYqacXaQ
24
- XI9jIhrfMy//2PgbHWcETtlJPBeNUbbSNBABcllUHKqYsVDlSvSmss034KSWNR8F
25
- bF1GcloicyvcCC4y6IoW4it0COAcdeaaxkxiBSgKdQFpff9REnDlIKK4uQ9lLxIo
26
- Y2G5xubiziKZkyfWFuSr67PIjW3Bu673D1JVBArhA1qbgQmYQcy1CkGOjo+iO8Nf
27
- 7u/QSfBHb+r/bXhKscDgPpnKwbUmvgO2+94zJG9KsrmIydlzYfsD09aXKx0t6Xy4
28
- 2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
- QWc=
23
+ 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAEjpaOXHHp8s/7GL2qCb
24
+ YAs7urOLv9VHSPfQWAwaTMVnSsIf3Sw4xzISOP/mmfEPBPXtz61K5esrE/uTFtgb
25
+ FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
26
+ 66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
27
+ cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
28
+ lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
+ W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-07-23 00:00:00.000000000 Z
31
+ date: 2021-04-18 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rails
@@ -45,229 +45,19 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '6.0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: bundler-audit
48
+ name: refinements
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.6'
54
- type: :development
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.2'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '14.2'
89
- - !ruby/object:Gem::Dependency
90
- name: git-lint
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '1.0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '1.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.13'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '0.13'
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.9'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '3.9'
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.83'
208
- type: :development
209
- prerelease: false
210
- version_requirements: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - "~>"
213
- - !ruby/object:Gem::Version
214
- version: '0.83'
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.39'
250
- type: :development
251
- prerelease: false
252
- version_requirements: !ruby/object:Gem::Requirement
253
- requirements:
254
- - - "~>"
255
- - !ruby/object:Gem::Version
256
- version: '1.39'
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.18'
60
+ version: '8.0'
271
61
  description:
272
62
  email:
273
63
  - brooke@alchemists.io
@@ -302,14 +92,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
302
92
  requirements:
303
93
  - - "~>"
304
94
  - !ruby/object:Gem::Version
305
- version: '2.7'
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.1.4
102
+ rubygems_version: 3.2.16
313
103
  signing_key:
314
104
  specification_version: 4
315
105
  summary: Enhances Rails with a DSL for menu navigation.
metadata.gz.sig CHANGED
Binary file