diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eca0157..236f628 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,6 +86,7 @@ jobs: coverage-check: permissions: + contents: read checks: write needs: test runs-on: ubuntu-latest diff --git a/.rubocop.yml b/.rubocop.yml index a86d318..4a01aa1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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 @@ -24,7 +28,7 @@ Layout/LineLength: Max: 120 Gemspec/RequiredRubyVersion: - Enabled: false + Enabled: false Layout/ParameterAlignment: EnforcedStyle: with_fixed_indentation @@ -47,8 +51,8 @@ Layout/EndAlignment: Style/PercentLiteralDelimiters: PreferredDelimiters: - '%w': "[]" - '%W': "[]" + "%w": "[]" + "%W": "[]" Style/StringLiterals: EnforcedStyle: double_quotes diff --git a/.rubocop_ignore_git.yml b/.rubocop_ignore_git.yml new file mode 100644 index 0000000..2cbac0e --- /dev/null +++ b/.rubocop_ignore_git.yml @@ -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 %> diff --git a/CHANGELOG.md b/CHANGELOG.md index d310294..4ba8480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Gemfile b/Gemfile index 01cdd86..15cf635 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/pundit.gemspec b/pundit.gemspec index a5b54b0..6a9dd01 100644 --- a/pundit.gemspec +++ b/pundit.gemspec @@ -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