navigator 6.0.0 → 6.1.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/README.adoc +5 -2
- data/app/helpers/navigator/navigation_helper.rb +2 -6
- data/lib/navigator/identity.rb +2 -2
- data/lib/navigator/menu.rb +2 -6
- data/lib/navigator/tag.rb +8 -16
- data.tar.gz.sig +0 -0
- metadata +15 -15
- 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: 1ffefb328882f63afb0efc8dc10be843a3bd5db70dd6e51be0fc11273e67509a
|
4
|
+
data.tar.gz: afc6018908a4294a444bdbdde805780e59cf51d988ec3cc4fe0d5f8165b37aaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33bf2371cd92f8cd41c8f931341a25cc7d001a3674043959dd4cde6eaaccc0ab7996bdc952ed60807e59362edcb31e3ce2ee48b830da5a83a491790579fbcda9
|
7
|
+
data.tar.gz: 3d1b47fdde1f0a9ce8cf9c56d78c24588a2294d74ce3291aa10a9dc629e48efb33bac2cb2ab892c789db40ecdd8c886d3a05362ebcec56228bdf6c371619c70e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -11,7 +11,10 @@ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchem
|
|
11
11
|
[link=https://circleci.com/gh/bkuhlmann/navigator]
|
12
12
|
image::https://circleci.com/gh/bkuhlmann/navigator.svg?style=svg[Circle CI Status]
|
13
13
|
|
14
|
-
|
14
|
+
Navigator is a Rails Engine that provides a domain specific language for menu navigation. Great for
|
15
|
+
situations in which you need dynamic, server-side, rendering of site navigation menus complete with
|
16
|
+
active page highlighting. You can also style your navigation menus with plain CSS or any CSS
|
17
|
+
framework of your choice.
|
15
18
|
|
16
19
|
toc::[]
|
17
20
|
|
@@ -349,7 +352,7 @@ Result:
|
|
349
352
|
</nav>
|
350
353
|
----
|
351
354
|
|
352
|
-
This is the default behavior for all navigation menus and is how menu items
|
355
|
+
This is the default behavior for all navigation menus and is how menu items automatically get the
|
353
356
|
"`active`" class when the item URL (in this case "`/home`") matches the `+request.env[“PATH_INFO"]+`
|
354
357
|
to indicate current page/active tab.
|
355
358
|
|
@@ -13,12 +13,8 @@ module Navigator
|
|
13
13
|
|
14
14
|
module_function
|
15
15
|
|
16
|
-
def current_path
|
17
|
-
request.env["PATH_INFO"]
|
18
|
-
end
|
16
|
+
def current_path = request.env["PATH_INFO"]
|
19
17
|
|
20
|
-
def navigation_activator
|
21
|
-
Navigator::TagActivator.new search_value: current_path
|
22
|
-
end
|
18
|
+
def navigation_activator = Navigator::TagActivator.new(search_value: current_path)
|
23
19
|
end
|
24
20
|
end
|
data/lib/navigator/identity.rb
CHANGED
data/lib/navigator/menu.rb
CHANGED
@@ -92,17 +92,13 @@ module Navigator
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
def render
|
96
|
-
[tag.prefix, tag.content, items.compact.join, tag.suffix].compact.join
|
97
|
-
end
|
95
|
+
def render = [tag.prefix, tag.content, items.compact.join, tag.suffix].compact.join
|
98
96
|
|
99
97
|
private
|
100
98
|
|
101
99
|
attr_accessor :template, :tag, :menu_activator, :items
|
102
100
|
|
103
|
-
def respond_to_missing?
|
104
|
-
ALLOWED_ELEMENTS.match?(name) || super
|
105
|
-
end
|
101
|
+
def respond_to_missing?(name, include_private = false) = ALLOWED_ELEMENTS.match?(name) || super
|
106
102
|
|
107
103
|
def activate_item_attributes! attributes, url, activator
|
108
104
|
return unless url == activator.search_value
|
data/lib/navigator/tag.rb
CHANGED
@@ -5,9 +5,7 @@ module Navigator
|
|
5
5
|
class Tag
|
6
6
|
attr_reader :name, :content
|
7
7
|
|
8
|
-
def self.names_without_suffix
|
9
|
-
%w[img input]
|
10
|
-
end
|
8
|
+
def self.names_without_suffix = %w[img input]
|
11
9
|
|
12
10
|
# rubocop:disable Metrics/ParameterLists
|
13
11
|
def initialize name, content = nil, attributes: {}, activator: Navigator::TagActivator.new
|
@@ -18,21 +16,13 @@ module Navigator
|
|
18
16
|
end
|
19
17
|
# rubocop:enable Metrics/ParameterLists
|
20
18
|
|
21
|
-
def prefix
|
22
|
-
["<#{name}", format_attributes, ">"].compact * ""
|
23
|
-
end
|
19
|
+
def prefix = ["<#{name}", format_attributes, ">"].compact.join
|
24
20
|
|
25
|
-
def computed_content
|
26
|
-
self.class.names_without_suffix.include?(name) ? nil : content
|
27
|
-
end
|
21
|
+
def computed_content = self.class.names_without_suffix.include?(name) ? nil : content
|
28
22
|
|
29
|
-
def suffix
|
30
|
-
self.class.names_without_suffix.include?(name) ? nil : "</#{name}>"
|
31
|
-
end
|
23
|
+
def suffix = self.class.names_without_suffix.include?(name) ? nil : "</#{name}>"
|
32
24
|
|
33
|
-
def render
|
34
|
-
[prefix, computed_content, suffix].compact * ""
|
35
|
-
end
|
25
|
+
def render = [prefix, computed_content, suffix].compact.join
|
36
26
|
|
37
27
|
private
|
38
28
|
|
@@ -45,7 +35,9 @@ module Navigator
|
|
45
35
|
end
|
46
36
|
|
47
37
|
def concatenate_attributes attrs
|
48
|
-
activator.activate(attrs)
|
38
|
+
activator.activate(attrs)
|
39
|
+
.map { |key, value| %(#{key}="#{value}") }
|
40
|
+
.join(" ")
|
49
41
|
end
|
50
42
|
|
51
43
|
def format_attributes
|
data.tar.gz.sig
CHANGED
Binary file
|
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: 6.
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |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+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
|
27
|
+
cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
|
28
|
+
lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
|
29
|
+
W2A=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2021-10-03 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rails
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '8.
|
53
|
+
version: '8.4'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '8.
|
60
|
+
version: '8.4'
|
61
61
|
description:
|
62
62
|
email:
|
63
63
|
- brooke@alchemists.io
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.2.
|
102
|
+
rubygems_version: 3.2.28
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Enhances Rails with a DSL for menu navigation.
|
metadata.gz.sig
CHANGED
Binary file
|