navigator 6.0.2 → 6.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f81e3a2019b6fd116de228b2c90d40b5345f87b62f53044060f9f1fef64923de
4
- data.tar.gz: f347f45ed7a4bda9dc8a84d121c2ed1dd3aa4e2d05e2aeba523b84a3286c0409
3
+ metadata.gz: 92e2a3089d84e37618c07782aa36a193a29d689bdb9d34c40e0bebd210e779bb
4
+ data.tar.gz: 3c756422dfb30e9056bb72e7a09445d17f937a91fbe2063718de0969cb913474
5
5
  SHA512:
6
- metadata.gz: 02b10e1420c9f59031f62efe923154cf9f5d677d0c8ee3195a700acef44dbb744ab32bda26d3d965e3fdc6f264deb97ddafd7e8073668439b1d57e3f04b30b6b
7
- data.tar.gz: 9826cc604ba1cdcb50916b484f4ec06697e18fa1e359e361db7d68821c9fa1966e9e59c856e0f4a6489b1e108375334fb0acaf4ad48fb5d49e026554451270c5
6
+ metadata.gz: e314d21ad031166736a41b236104bc4cec6fff786af20215c142c62a3ea8ef7a80e85b36da351cb32937ff2235bc8617efe87b747616c86d821161f3591675b1
7
+ data.tar.gz: ac4a00e5ad611bb456c5b5f6ecd1d5542d8ecb3cfe8e26bf3f5b719e01e55e6656206e77330d77ddf5ac7be0653a635ca1b564feb8adf7a7c8c970b6514b8dca
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.2"
9
- VERSION_LABEL = "#{LABEL} #{VERSION}"
8
+ VERSION = "6.0.3"
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.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2021-08-07 00:00:00.000000000 Z
31
+ date: 2021-09-05 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rails
@@ -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.25
102
+ rubygems_version: 3.2.27
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