gretel 4.4.0 → 4.6.0

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: e903af36913aacbf98679ae5452d7269b9eba6abf5b2d75ff6a60277c2d64ad1
4
- data.tar.gz: 56bcc5194372d75c357fcde07a542ffcd7440fa3ade06738124573d29d3cbf7b
3
+ metadata.gz: ee8686486b44e9ee694e8c8c2119eb8604b497364d917888d9ad18e5de3fabc9
4
+ data.tar.gz: 147d47f70341f2da748ac68ab643ccf17c5cf34612ddbfd0687efa6c63b81f41
5
5
  SHA512:
6
- metadata.gz: e20387223c47146510f79c77f3680ad3f76c8d703a455c7991fd68ec68d5011f79427fe39d56ccd8e0b8e942522632fc1cb448b12e02d6910214b8fe27eb65de
7
- data.tar.gz: 9612998182b479f2e9f023e64ba8527897a8058a1c59268cb86583f3647b818be978e0c91b4f9740abbbd749c02ee03159fd4b8826377e03e6aef578375e9da3
6
+ metadata.gz: ef1dcc6ea9a4ebdd67a548ac45382b19b4750c500c49b3d31f79f2cb4a54f237694942d2cf947761c53045ea56563bf3c9fa2f858fd52887c009e0d054535f2d
7
+ data.tar.gz: e982ef28a0e8df216a0ebc1208fe18bc37686733a2e0068cbc41fdc341c9c1d117d2c15ee1f1cbc466bd896544a2a4ccfcd80bfef1cbb949260c1458f6b17497
@@ -11,39 +11,45 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- rails_version: [5.1.0, 5.2.0, 6.0.0, 6.1.0, master]
15
- ruby_version: [3.0, 2.7, 2.6, 2.5]
14
+ rails_version: [5.1.0, 5.2.0, 6.0.0, 6.1.0, 7.0.0, 7.1.0, master]
15
+ ruby_version: ['3.2', '3.1', '3.0', '2.7', '2.6']
16
16
  exclude:
17
- - ruby_version: 2.5
18
- rails_version: master
19
- - ruby_version: 2.6
20
- rails_version: master
21
- - ruby_version: 3.0
22
- rails_version: 5.1.0
23
- - ruby_version: 3.0
24
- rails_version: 5.2.0
17
+ - { ruby_version: '2.6', rails_version: 7.0.0 }
18
+ - { ruby_version: '2.6', rails_version: 7.1.0 }
19
+ - { ruby_version: '2.6', rails_version: master }
20
+ - { ruby_version: '3.0', rails_version: 5.1.0 }
21
+ - { ruby_version: '3.0', rails_version: 5.2.0 }
22
+ - { ruby_version: '3.1', rails_version: 5.1.0 }
23
+ - { ruby_version: '3.1', rails_version: 5.2.0 }
24
+ - { ruby_version: '3.1', rails_version: 6.0.0 }
25
+ - { ruby_version: '3.1', rails_version: 6.1.0 }
26
+ - { ruby_version: '3.2', rails_version: 5.1.0 }
27
+ - { ruby_version: '3.2', rails_version: 5.2.0 }
28
+ - { ruby_version: '3.2', rails_version: 6.0.0 }
29
+ - { ruby_version: '3.2', rails_version: 6.1.0 }
25
30
 
26
31
  steps:
27
- - uses: actions/checkout@v2
32
+ - uses: actions/checkout@v3
28
33
 
29
34
  - name: Setup Ruby
30
35
  uses: ruby/setup-ruby@v1
31
36
  with:
32
- ruby-version: ${{ matrix.ruby_version }}
37
+ ruby-version: "${{ matrix.ruby_version }}"
33
38
 
34
39
  - name: Run test
35
40
  env:
36
- RAILS_VERSION: ${{ matrix.rails_version }}
41
+ RAILS_VERSION: "${{ matrix.rails_version }}"
37
42
  run: |
43
+ gem update --system
38
44
  bundle update
39
45
  cd spec/dummy; rake db:migrate db:test:prepare; cd ../..
40
46
  bundle exec rake
41
47
 
42
48
  - name: Upload coverage
43
- uses: actions/upload-artifact@v2
49
+ uses: actions/upload-artifact@v3
44
50
  if: always()
45
51
  with:
46
- name: coverage-ruby-${{ matrix.ruby_version }}-rails-${{ matrix.rails_version }}
52
+ name: "coverage-ruby-${{ matrix.ruby_version }}-rails-${{ matrix.rails_version }}"
47
53
  path: coverage
48
54
 
49
55
  - name: Show coverage
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## Version 4.6.0
6
+ * Support Rails 7.1
7
+
8
+ ## Version 4.5.0
9
+ * Use `link` element for link item in semantic markup instead of `meta` element (via #36, thanks @tkawa)
10
+ * Add `link_data` option to set data attributes for link item (via #38, thanks @SpaYco)
11
+
5
12
  ## Version 4.4.0
6
13
  * Support Bootstrap 5. See the `:style` option in the readme for more info (via #30, thanks @tochi)
7
14
  * Support Rails 7.0
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/gretel.svg)](http://badge.fury.io/rb/gretel)
2
- ![](https://github.com/kzkn/gretel/workflows/CI/badge.svg)
2
+ [![](https://github.com/kzkn/gretel/workflows/CI/badge.svg)](https://github.com/kzkn/gretel/actions/workflows/ci.yml)
3
3
 
4
4
  <img src="http://i.imgur.com/CAKEaBM.png" alt="Handle breadcrumb trails... like a boss :)" />
5
5
 
@@ -100,6 +100,7 @@ Option | Description
100
100
  :container_tag | Tag type that contains the breadcrumbs. | `:div`
101
101
  :fragment_tag | Tag type to contain each breadcrumb fragment/link. | None
102
102
  :aria_current | Value of `aria-current` attribute. | None
103
+ :link_data | Adds data attributes to breadcrumb | `nil`
103
104
 
104
105
  ### Styles
105
106
 
data/gretel.gemspec CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |gem|
19
19
  "changelog_uri" => "https://github.com/kzkn/gretel/blob/master/CHANGELOG.md",
20
20
  }
21
21
 
22
- gem.add_dependency "railties", [">= 5.1", "< 7.1"]
23
- gem.add_dependency "actionview", [">= 5.1", "< 7.1"]
22
+ gem.add_dependency "railties", [">= 5.1", "< 7.2"]
23
+ gem.add_dependency "actionview", [">= 5.1", "< 7.2"]
24
24
  gem.add_development_dependency "sqlite3"
25
25
  gem.add_development_dependency "rspec-rails"
26
26
  gem.add_development_dependency "simplecov"
@@ -19,7 +19,8 @@ module Gretel
19
19
  posttext_class: "posttext",
20
20
  link_class: nil,
21
21
  id: nil,
22
- aria_current: nil
22
+ aria_current: nil,
23
+ link_data: nil
23
24
  }
24
25
 
25
26
  DEFAULT_STYLES = {
@@ -87,7 +88,7 @@ module Gretel
87
88
  end
88
89
 
89
90
  # Set current link to actual path
90
- if options[:link_current_to_request_path] && out.any? && request
91
+ if options[:link_current_to_request_path] && out.any? && request&.fullpath.present?
91
92
  out.last.url = request.fullpath
92
93
  end
93
94
 
@@ -265,7 +266,7 @@ module Gretel
265
266
  end
266
267
 
267
268
  def fragment_options
268
- options.slice(:fragment_class, :link_class)
269
+ options.slice(:fragment_class, :link_class, :link_data)
269
270
  end
270
271
 
271
272
  def join_classes(*classes)
@@ -290,13 +291,13 @@ module Gretel
290
291
 
291
292
  if fragment_tag
292
293
  if url.present?
293
- text = breadcrumb_link_to(text, url, "aria-current": options[:aria_current])
294
+ text = breadcrumb_link_to(text, url, "aria-current": options[:aria_current], data: options[:link_data])
294
295
  content_tag(fragment_tag, text, class: fragment_class)
295
296
  else
296
- content_tag(fragment_tag, text, class: fragment_class, "aria-current": options[:aria_current])
297
+ content_tag(fragment_tag, text, class: fragment_class, "aria-current": options[:aria_current], data: options[:link_data])
297
298
  end
298
299
  elsif url.present?
299
- breadcrumb_link_to(text, url, class: join_classes(fragment_class, options[:link_class]), "aria-current": options[:aria_current])
300
+ breadcrumb_link_to(text, url, class: join_classes(fragment_class, options[:link_class]), "aria-current": options[:aria_current], data: options[:link_data])
300
301
  elsif options[:class].present?
301
302
  content_tag(:span, text, class: fragment_class, "aria-current": options[:aria_current])
302
303
  else
@@ -317,15 +318,14 @@ module Gretel
317
318
 
318
319
  aria_current = options[:aria_current]
319
320
  if url.present?
320
- text = breadcrumb_link_to(text, url, itemprop: "item", "aria-current": aria_current, class: options[:link_class])
321
+ text = breadcrumb_link_to(text, url, itemprop: "item", "aria-current": aria_current, class: options[:link_class], data: options[:link_data])
321
322
  aria_current = nil
322
323
  elsif options[:current_link].present?
323
- current_url = "#{root_url}#{options[:current_link].gsub(/^\//, '')}"
324
- text = text + tag(:meta, itemprop: "item", content: current_url)
324
+ text = text + tag(:link, itemprop: "item", href: options[:current_link])
325
325
  end
326
326
 
327
- text = text + tag(:meta, itemprop:"position", content: "#{position}")
328
- content_tag(fragment_tag.to_sym, text, class: fragment_class, itemprop: "itemListElement", itemscope: "", itemtype: "https://schema.org/ListItem", "aria-current": aria_current)
327
+ text = text + tag(:meta, itemprop: "position", content: "#{position}")
328
+ content_tag(fragment_tag.to_sym, text, class: fragment_class, itemprop: "itemListElement", itemscope: "", itemtype: "https://schema.org/ListItem", "aria-current": aria_current, data: options[:link_data])
329
329
  end
330
330
 
331
331
  def render_container(html)
@@ -1,3 +1,3 @@
1
1
  module Gretel
2
- VERSION = "4.4.0"
2
+ VERSION = "4.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gretel
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lasse Bunk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-16 00:00:00.000000000 Z
12
+ date: 2023-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '5.1'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7.1'
23
+ version: '7.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '5.1'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.1'
33
+ version: '7.2'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: actionview
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '5.1'
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '7.1'
43
+ version: '7.2'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: '5.1'
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '7.1'
53
+ version: '7.2'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: sqlite3
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 3.2.15
159
+ rubygems_version: 3.4.6
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Flexible Ruby on Rails breadcrumbs plugin.