Skip to content

Commit 7aa30eb

Browse files
authored
Merge pull request #870 from varvet/kbs/ruby-4.0
JRuby 9.3 is EOL, so we move to 9.4
2 parents 3488802 + de12578 commit 7aa30eb

32 files changed

+50
-264
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ on:
99
permissions:
1010
contents: read
1111

12-
env:
13-
# `github.ref` points to the *merge commit* when running tests on a pull request, which will be a commit
14-
# that doesn't exists in our code base. Since this workflow triggers from a PR, we use the HEAD SHA instead.
15-
#
16-
# NOTE: These both used to be used by Code Climate (cc-test-reporter), superseded by qlty.sh
17-
GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
18-
GIT_BRANCH: ${{ github.head_ref }}
19-
2012
jobs:
2113
matrix-test:
2214
runs-on: ubuntu-latest
@@ -29,7 +21,7 @@ jobs:
2921
- "3.3"
3022
- "3.4"
3123
- "4.0"
32-
- "jruby-9.3.15"
24+
- "jruby-9.4"
3325
- "jruby"
3426
include: # HEAD-versions
3527
- ruby-version: "head"
@@ -72,46 +64,7 @@ jobs:
7264
path: coverage
7365
retention-days: 1
7466

75-
coverage-upload:
76-
permissions:
77-
id-token: write # Required for OIDC
78-
needs: test
79-
runs-on: ubuntu-latest
80-
steps:
81-
- uses: actions/checkout@v4
82-
- name: Download coverage results
83-
uses: actions/download-artifact@v4
84-
with:
85-
name: coverage-results
86-
path: coverage
87-
- name: Upload code coverage to qlty.sh
88-
uses: qltysh/qlty-action/coverage@v2
89-
with:
90-
oidc: true
91-
format: simplecov
92-
files: coverage/.resultset.json
93-
94-
coverage-check:
95-
permissions:
96-
contents: read
97-
checks: write
98-
needs: test
99-
runs-on: ubuntu-latest
100-
steps:
101-
- uses: actions/checkout@v4
102-
- name: Download coverage results
103-
uses: actions/download-artifact@v4
104-
with:
105-
name: coverage-results
106-
path: coverage
107-
- uses: joshmfrankel/simplecov-check-action@be89e11889202cc59efb14aab2a7091622fa9aad
108-
with:
109-
github_token: ${{ secrets.GITHUB_TOKEN }}
110-
minimum_suite_coverage: 100
111-
minimum_file_coverage: 100
112-
coverage_json_path: coverage/simplecov-check-action.json
113-
114-
rubocop:
67+
linting:
11568
runs-on: ubuntu-latest
11669
steps:
11770
- uses: actions/checkout@v4
@@ -122,8 +75,8 @@ jobs:
12275
ruby-version: "ruby"
12376
bundler-cache: false
12477
- run: bundle install
125-
- name: Run RuboCop
126-
run: bundle exec rubocop
78+
- name: Run standard
79+
run: bundle exec standardrb
12780

12881
docs:
12982
runs-on: ubuntu-latest
@@ -145,7 +98,7 @@ jobs:
14598
- test
14699
- matrix-test
147100
- docs
148-
- rubocop
101+
- linting
149102
steps:
150103
- name: failure
151104
if: ${{ failure() || contains(needs.*.result, 'failure') }}

.rubocop.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.standard.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parallel: true
2+
ruby_version: 3.2
3+
4+
extend_config:
5+
- .rubocop_ignore_git.yml

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ gem "simplecov", ">= 0.17.0"
1616
# Development tools
1717
gem "bundler"
1818
gem "rake"
19-
gem "rubocop"
20-
gem "rubocop-performance"
21-
gem "rubocop-rspec"
19+
gem "standard"
2220
gem "yard"
2321
gem "zeitwerk"
2422

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Pundit
22

33
[![Main](https://github.com/varvet/pundit/actions/workflows/main.yml/badge.svg)](https://github.com/varvet/pundit/actions/workflows/main.yml)
4-
[![Maintainability](https://qlty.sh/gh/varvet/projects/pundit/maintainability.svg)](https://qlty.sh/gh/varvet/projects/pundit)
54
[![Inline docs](https://inch-ci.org/github/varvet/pundit.svg?branch=main)](https://inch-ci.org/github/varvet/pundit)
65
[![Gem Version](https://badge.fury.io/rb/pundit.svg)](https://badge.fury.io/rb/pundit)
76

lib/pundit.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
require "pundit/cache_store"
1212
require "pundit/cache_store/null_store"
1313
require "pundit/cache_store/legacy_store"
14+
15+
# :nocov:
1416
require "pundit/railtie" if defined?(Rails)
17+
# :nocov:
1518

1619
# Hello? Yes, this is Pundit.
1720
#

lib/pundit/error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def initialize(options = {})
3737
if options.is_a? String
3838
message = options
3939
else
40-
@query = options[:query]
40+
@query = options[:query]
4141
@record = options[:record]
4242
@policy = options[:policy]
4343

lib/pundit/rspec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module DSL
129129
# @param list [Symbol, Array<Symbol>] a permission to describe
130130
# @return [void]
131131
def permissions(*list, &block)
132-
metadata = { permissions: list, caller: caller }
132+
metadata = {permissions: list, caller: caller}
133133

134134
if list.last == :focus
135135
list.pop

pundit.gemspec

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
require_relative "lib/pundit/version"
44

55
Gem::Specification.new do |gem|
6-
gem.name = "pundit"
7-
gem.version = Pundit::VERSION
8-
gem.authors = ["Jonas Nicklas", "Varvet AB"]
9-
gem.email = ["jonas.nicklas@gmail.com", "info@varvet.com"]
10-
gem.description = "Object oriented authorization for Rails applications"
11-
gem.summary = "OO authorization for Rails"
12-
gem.homepage = "https://github.com/varvet/pundit"
13-
gem.license = "MIT"
6+
gem.name = "pundit"
7+
gem.version = Pundit::VERSION
8+
gem.authors = ["Jonas Nicklas", "Varvet AB"]
9+
gem.email = ["jonas.nicklas@gmail.com", "info@varvet.com"]
10+
gem.description = "Object oriented authorization for Rails applications"
11+
gem.summary = "OO authorization for Rails"
12+
gem.homepage = "https://github.com/varvet/pundit"
13+
gem.license = "MIT"
1414

1515
Dir.chdir(__dir__) do
1616
gem.files = `git ls-files -z`.split("\x0").select do |f|

spec/authorization_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def to_params(*args, **kwargs, &block)
231231
end
232232

233233
it "goes through the policy cache" do
234-
params = to_params(post: { title: "Hello" })
234+
params = to_params(post: {title: "Hello"})
235235
user = double
236236
post = Post.new(user)
237237
controller = Controller.new(user, "update", params)

0 commit comments

Comments
 (0)