inferred_crumpets 0.4.0 → 0.6.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: ac975b81fe34e00d8c02a575c79403bec5ab71c5aa5e597ce53932bc47306563
4
- data.tar.gz: ae781ae8cc74315609e8d0d361b73a9f67993c881f72a24a910baac6e02681db
3
+ metadata.gz: 7f19c79f1601d1354dca9c7c344ca8d7b00dad278d5de5c8559db7d3ea76c7ef
4
+ data.tar.gz: ea54714882c5e014f99069a5b9496ca893875c22f61d24b2880666ea251d2dc7
5
5
  SHA512:
6
- metadata.gz: d926b7e1c2c91a41428c6459d4597159c066b136ac44851c37d2f9689485fcac1cdd6df9bcf164b2d72e8cde2018f6b87789201b69241e6beba30c1827bd2614
7
- data.tar.gz: e949c53ddc47ba83606be1c840825dcaa3d73eec6570cb970abc12fdeec2759e52a4ac26da979e717c3d34b6764b025a8e83930bd032fb5276213b2ba64c6f50
6
+ metadata.gz: af1daa0b2776872524937e773f0a5485efa45bbc672cee49aaf00a103e95a1adcfe87fb3bf9a8c3a1becf1a61c2fbcbeb4462d96961dab8267c985dacbfad7ee
7
+ data.tar.gz: e1fec9439a4b0188a7e55387916c2fd6ad4d78179c7d2f7f00c914101afebabc416feea94558a5025789cfe61fdca6df3d9f1181a19502493673ca5bbe9b859e
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
@@ -0,0 +1,59 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ name: Build
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ bundler-cache: true
18
+ - run: bundle exec rake
19
+
20
+ release:
21
+ needs: build
22
+ name: Release
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v2
27
+
28
+ - name: Generate Changelog
29
+ run: |
30
+ # Get version from github ref (remove 'refs/tags/' and prefix 'v')
31
+ version="${GITHUB_REF#refs/tags/v}"
32
+ npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
33
+
34
+ - name: Release
35
+ uses: softprops/action-gh-release@v1
36
+ with:
37
+ body_path: ${{ github.workflow }}-CHANGELOG.txt
38
+ env:
39
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ publish:
42
+ needs: [build, release]
43
+ name: Publish
44
+ runs-on: ubuntu-latest
45
+
46
+ steps:
47
+ - uses: actions/checkout@v2
48
+ - uses: ruby/setup-ruby@v1
49
+
50
+ - name: Publish to RubyGems
51
+ run: |
52
+ mkdir -p $HOME/.gem
53
+ touch $HOME/.gem/credentials
54
+ chmod 0600 $HOME/.gem/credentials
55
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
56
+ gem build *.gemspec
57
+ gem push *.gem
58
+ env:
59
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,21 @@
1
+ name: Build and Test
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ ruby: ["2.6", "2.7", "3.0", "3.1"]
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: ${{ matrix.ruby }}
15
+ bundler-cache: true
16
+ - run: bundle exec rake
17
+ - name: Coveralls
18
+ uses: coverallsapp/github-action@master
19
+ with:
20
+ github-token: ${{ secrets.GITHUB_TOKEN }}
21
+ path-to-lcov: coverage/lcov.info
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # InferredCrumpets
2
2
 
3
+ ## 0.6.0
4
+
5
+ - [PLAT-183] Ruby 3.1, coveralls via github actions
6
+
7
+ ## 0.5.0
8
+
9
+ - [TT-8631] Update to build with github actions / ruby 3.0 / rails 6.1
10
+
11
+ ## 0.4.2
12
+
13
+ * [TT-6224] ActiveRecord::Base subjects can now take a custom crumb name
14
+
15
+ ## 0.4.1
16
+
17
+ * [TT-5835] Fix crumb title for active record relation
18
+
3
19
  ## 0.4.0
4
20
 
5
21
  * [TT-5807] Use crumb title for the subject name
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # InferredCrumpets
2
2
 
3
- [![Build Status](https://travis-ci.org/sealink/inferred_crumpets.svg?branch=master)](https://travis-ci.org/sealink/inferred_crumpets)
3
+ [![Gem Version](https://badge.fury.io/rb/inferred_crumpets.svg)](http://badge.fury.io/rb/inferred_crumpets)
4
+ [![Build Status](https://github.com/sealink/inferred_crumpets/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/inferred_crumpets/actions)
5
+ [![Coverage Status](https://coveralls.io/repos/github/sealink/inferred_crumpets/badge.svg?branch=master)](https://coveralls.io/github/sealink/inferred_crumpets?branch=master)
4
6
 
5
7
  Automatic breadcrumbs for Rails. Built with [crumpet](https://github.com/blaknite/crumpet).
6
8
 
@@ -24,11 +26,22 @@ In the view call `render_inferred_crumbs`
24
26
 
25
27
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
28
 
29
+ ## Release
30
+
31
+ To publish a new version of this gem the following steps must be taken.
32
+
33
+ * Update the version in the following files
34
+ ```
35
+ CHANGELOG.md
36
+ lib/inferred_crumpets/version.rb
37
+ ````
38
+ * Create a tag using the format v0.1.0
39
+ * Follow build progress in GitHub actions
40
+
27
41
  ## Contributing
28
42
 
29
43
  Bug reports and pull requests are welcome on GitHub at https://github.com/sealink/inferred_crumpets. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
30
44
 
31
-
32
45
  ## License
33
46
 
34
47
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -20,11 +20,13 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = "exe"
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
+ spec.required_ruby_version = '>= 2.6.0'
23
24
 
24
- spec.add_dependency "rails", ">= 5"
25
+ spec.add_dependency "rails", ">= 6"
25
26
  spec.add_dependency "crumpet", ">= 0.3.0"
26
27
 
27
28
  spec.add_development_dependency "bundler"
28
29
  spec.add_development_dependency "rake"
29
30
  spec.add_development_dependency "rspec"
31
+ spec.add_development_dependency "coverage-kit"
30
32
  end
@@ -45,8 +45,10 @@ module InferredCrumpets
45
45
  def build_crumb_for_collection!
46
46
  return if parents.present? && linkable?
47
47
 
48
- if subject.is_a?(ActiveRecord::Relation)
49
- view_context.crumbs.add_crumb subject_name.pluralize.titleize
48
+ if subject.class.respond_to?(:collection_title)
49
+ view_context.crumbs.add_crumb subject.class.collection_title, url_for_collection
50
+ elsif subject.is_a?(ActiveRecord::Relation)
51
+ view_context.crumbs.add_crumb relation_name.pluralize.titleize
50
52
  elsif subject.is_a?(ActiveRecord::Base)
51
53
  view_context.crumbs.add_crumb subject.class.table_name.titleize, url_for_collection
52
54
  end
@@ -107,6 +109,10 @@ module InferredCrumpets
107
109
  view_context.params[:action]
108
110
  end
109
111
 
112
+ def relation_name
113
+ subject.respond_to?(:name) && subject.name.present? ? subject.name : subject.to_s
114
+ end
115
+
110
116
  def subject_name
111
117
  subject.respond_to?(:crumb_title) && subject.crumb_title.present? ? subject.crumb_title : subject.to_s
112
118
  end
@@ -114,9 +120,5 @@ module InferredCrumpets
114
120
  def class_with_parents
115
121
  [parents.last, transformed_subject.class].compact
116
122
  end
117
-
118
- def inherited_resources?
119
- defined?(InheritedResources) && view_context.controller.responder == InheritedResources::Responder
120
- end
121
123
  end
122
124
  end
@@ -1,3 +1,3 @@
1
1
  module InferredCrumpets
2
- VERSION = "0.4.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferred_crumpets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Colegate
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-05 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5'
19
+ version: '6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5'
26
+ version: '6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: crumpet
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coverage-kit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Automatic breadcrumbs for Rails.
84
98
  email:
85
99
  - support@travellink.com.au
@@ -87,10 +101,12 @@ executables: []
87
101
  extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
104
+ - ".github/dependabot.yml"
105
+ - ".github/workflows/release.yml"
106
+ - ".github/workflows/ruby.yml"
90
107
  - ".gitignore"
91
108
  - ".rspec"
92
109
  - ".ruby-version"
93
- - ".travis.yml"
94
110
  - CHANGELOG.md
95
111
  - CODE_OF_CONDUCT.md
96
112
  - Gemfile
@@ -120,14 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
136
  requirements:
121
137
  - - ">="
122
138
  - !ruby/object:Gem::Version
123
- version: '0'
139
+ version: 2.6.0
124
140
  required_rubygems_version: !ruby/object:Gem::Requirement
125
141
  requirements:
126
142
  - - ">="
127
143
  - !ruby/object:Gem::Version
128
144
  version: '0'
129
145
  requirements: []
130
- rubygems_version: 3.0.3
146
+ rubygems_version: 3.3.3
131
147
  signing_key:
132
148
  specification_version: 4
133
149
  summary: Automatic breadcrumbs for Rails.
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
- - 2.5
5
- - 2.6
6
- before_install:
7
- - gem install bundler
8
- notifications:
9
- email:
10
- - support@travellink.com.au