Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to changelog in gemspec #845

Merged
merged 5 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:

coverage-check:
permissions:
contents: read
checks: write
needs: test
runs-on: ubuntu-latest
Expand Down
20 changes: 12 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
inherit_from: .rubocop_ignore_git.yml

AllCops:
TargetRubyVersion: 3.1
Exclude:
- "lib/generators/**/templates/**/*"
<% `git status --ignored --porcelain`.lines.grep(/^!! /).each do |path| %>
- <%= path.sub(/^!! /, '').sub(/\/$/, '/**/*') %>
<% end %>
SuggestExtensions: false
NewCops: disable

Gemspec/DeprecatedAttributeAssignment:
Enabled: true

Gemspec/DevelopmentDependencies:
Enabled: true

Metrics/BlockLength:
Exclude:
- "**/*_spec.rb"
- pundit.gemspec

Metrics/MethodLength:
Max: 40
Expand All @@ -24,7 +28,7 @@ Layout/LineLength:
Max: 120

Gemspec/RequiredRubyVersion:
Enabled: false
Enabled: false

Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Expand All @@ -47,8 +51,8 @@ Layout/EndAlignment:

Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': "[]"
'%W': "[]"
"%w": "[]"
"%W": "[]"

Style/StringLiterals:
EnforcedStyle: double_quotes
Expand Down
7 changes: 7 additions & 0 deletions .rubocop_ignore_git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is here so we can keep YAML syntax highlight in the main file.
AllCops:
Exclude:
- "lib/generators/**/templates/**/*"
<% `git status --ignored --porcelain`.lines.grep(/^!! /).each do |path| %>
- <%= path.sub(/^!! /, '').sub(/\/$/, '/**/*') %>
<% end %>
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Added

- Add `Pundit::Authorization#pundit_reset!` hook to reset the policy and policy scope cache. (#830)
- Add links to gemspec. (#845)

## Changed

Expand Down
18 changes: 18 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ source "https://rubygems.org"

gemspec

# Rails-related - for testing purposes
gem "actionpack", ">= 3.0.0" # Used to test strong parameters
gem "activemodel", ">= 3.0.0" # Used to test ActiveModel::Naming
gem "railties", ">= 3.0.0" # Used to test generators

# Testing
gem "rspec", ">= 3.0.0"
gem "simplecov", ">= 0.17.0"

# Development tools
gem "bundler"
gem "rake"
gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rspec"
gem "yard"
gem "zeitwerk"

# Affects us on JRuby 9.3.15.
#
# @see https://github.com/rails/rails/issues/54260
Expand Down
20 changes: 8 additions & 12 deletions pundit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ Gem::Specification.new do |gem|

gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.metadata = { "rubygems_mfa_required" => "true" }
gem.metadata = {
"rubygems_mfa_required" => "true",
"bug_tracker_uri" => "https://github.com/varvet/pundit/issues",
"changelog_uri" => "https://github.com/varvet/pundit/blob/main/CHANGELOG.md",
"documentation_uri" => "https://github.com/varvet/pundit/blob/main/README.md",
"homepage_uri" => "https://github.com/varvet/pundit",
"source_code_uri" => "https://github.com/varvet/pundit"
}

gem.add_dependency "activesupport", ">= 3.0.0"
gem.add_development_dependency "actionpack", ">= 3.0.0" # Used to test strong parameters.
gem.add_development_dependency "activemodel", ">= 3.0.0" # Used to test ActiveModel::Naming.
gem.add_development_dependency "bundler"
gem.add_development_dependency "railties", ">= 3.0.0" # Used to test generators.
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", ">= 3.0.0"
gem.add_development_dependency "rubocop"
gem.add_development_dependency "simplecov", ">= 0.17.0"
gem.add_development_dependency "yard"
gem.add_development_dependency "zeitwerk"
end