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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ee02c41b532e95fefe52fb97b3cf417280a700b11676c5c1de437b3db5e9a47
4
- data.tar.gz: 95a01b5614e1b220f9f90d3841f4b92706230fde8a925542ccc19ff01eea1528
3
+ metadata.gz: 1ffefb328882f63afb0efc8dc10be843a3bd5db70dd6e51be0fc11273e67509a
4
+ data.tar.gz: afc6018908a4294a444bdbdde805780e59cf51d988ec3cc4fe0d5f8165b37aaa
5
5
  SHA512:
6
- metadata.gz: e94df980f74d11a7519d8c36b4a23b840a57d2473cae43213fd028f1748a3598545d5f2b2e39aea2dca0da60de830adf74b3fc775e2773ae17aca38a5f213f42
7
- data.tar.gz: 7bd58c0e413a8f27b6af5391c573458f49a8b6a8c878e4fee3f8e0ed140fc0df5ae98c2d2c47e9b98ea309e5098c31197d338b6c44d227100d6df2c9549f841b
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
- Enhances Rails with a DSL for menu navigation.
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 automaticaly get the
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
@@ -5,7 +5,7 @@ module Navigator
5
5
  module Identity
6
6
  NAME = "navigator"
7
7
  LABEL = "Navigator"
8
- VERSION = "6.0.0"
9
- VERSION_LABEL = "#{LABEL} #{VERSION}"
8
+ VERSION = "6.1.0"
9
+ VERSION_LABEL = "#{LABEL} #{VERSION}".freeze
10
10
  end
11
11
  end
@@ -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? name, include_private = false
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).map { |key, value| %(#{key}="#{value}") } * " "
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.0.0
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
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
- NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNo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lXPocZv
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-12-30 00:00:00.000000000 Z
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.0'
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.0'
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.3
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