diff --git a/.github/workflows/docs-lint.yml b/.github/workflows/docs-lint.yml index bfd48d0..cef5c9e 100644 --- a/.github/workflows/docs-lint.yml +++ b/.github/workflows/docs-lint.yml @@ -7,75 +7,16 @@ on: paths: - "*.md" - "**/*.md" - - "gemfiles/rubocop.gemfile" - - "rubocop-md.yml" - - "rubocop.yml" - - ".mdlrc" - - "forspell.dict" + - ".github/workflows/docs-lint.yml" pull_request: paths: - "*.md" - "**/*.md" - - "gemfiles/rubocop.gemfile" - - "rubocop-md.yml" - - "rubocop.yml" - - ".mdlrc" - - "forspell.dict" + - ".github/workflows/docs-lint.yml" jobs: - markdownlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - - name: Run Markdown linter - run: | - gem install mdl - mdl **/*.md - - rubocop: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - - name: Lint Markdown files with RuboCop - run: | - gem install bundler - bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3 - bundle exec --gemfile gemfiles/rubocop.gemfile rubocop -c .rubocop-md.yml - - forspell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Hunspell - run: | - sudo apt-get install hunspell - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - - name: Cache installed gems - uses: actions/cache@v1 - with: - path: /home/runner/.rubies/ruby-2.7.0/lib/ruby/gems/2.7.0 - key: gems-cache-${{ runner.os }} - - name: Install Forspell - run: gem install forspell - - name: Run Forspell - run: forspell **/*.md *.md - - lychee: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Link Checker - id: lychee - uses: lycheeverse/lychee-action@v1.5.1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - args: docs README.md CHANGELOG.md -v + docs-lint: + uses: anycable/github-actions/.github/workflows/docs-lint.yml@master + with: + forspell-args: "*.md" + mdl-path: README.md CHANGELOG.md diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 438e7fc..acac6e1 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -10,13 +10,14 @@ on: jobs: rubocop: runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: "gemfiles/rubocop.gemfile" steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.1 + bundler-cache: true - name: Lint Ruby code with RuboCop run: | - gem install bundler - bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3 - bundle exec --gemfile gemfiles/rubocop.gemfile rubocop + bundle exec rubocop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9f9a6f..2ba80e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,9 @@ jobs: coverage: "false" - ruby: "3.2" gemfile: "gemfiles/rails7.gemfile" + coverage: "false" + - ruby: "3.3" + gemfile: "gemfiles/rails71.gemfile" coverage: "true" - ruby: "3.1" gemfile: "gemfiles/railsmaster.gemfile" diff --git a/.rubocop.yml b/.rubocop.yml index fb36f78..dacaacf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -27,6 +27,5 @@ Naming/FileName: Exclude: - '**/*.md' -# FIXME: Enable back when Ruby Next 0.14 is released -Layout/SpaceAfterColon: +Style/ArgumentsForwarding: Enabled: false diff --git a/LICENSE.txt b/LICENSE.txt index 704d126..43b1676 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018-2023 Vladimir Dementyev +Copyright (c) 2018-2024 Vladimir Dementyev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/action_policy.gemspec b/action_policy.gemspec index 04dc72a..cfc3a03 100644 --- a/action_policy.gemspec +++ b/action_policy.gemspec @@ -30,9 +30,9 @@ Gem::Specification.new do |spec| # When gem is installed from source, we add `ruby-next` as a dependency # to auto-transpile source files during the first load if ENV["RELEASING_GEM"].nil? && File.directory?(File.join(__dir__, ".git")) - spec.add_runtime_dependency "ruby-next", ">= 0.14.0" + spec.add_runtime_dependency "ruby-next", ">= 1.0" else - spec.add_dependency "ruby-next-core", ">= 0.14.0" + spec.add_dependency "ruby-next-core", ">= 1.0" end spec.add_development_dependency "ammeter", "~> 1.1.3" diff --git a/gemfiles/rails7.gemfile b/gemfiles/rails7.gemfile index 6d268c2..3fe95d8 100644 --- a/gemfiles/rails7.gemfile +++ b/gemfiles/rails7.gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" gem "sqlite3" -gem "rails", "~> 7.0" +gem "rails", "~> 7.0.0" gem "method_source" gem "unparser" diff --git a/gemfiles/rails71.gemfile b/gemfiles/rails71.gemfile new file mode 100644 index 0000000..cbe707c --- /dev/null +++ b/gemfiles/rails71.gemfile @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +gem "sqlite3" +gem "rails", "~> 7.1.0" +gem "method_source" +gem "unparser" + +if ENV["COVERAGE"] == "true" + gem "simplecov" + gem "simplecov-lcov" +end + +gemspec path: ".." diff --git a/gemfiles/rubocop.gemfile b/gemfiles/rubocop.gemfile index 177ccd0..57b2000 100644 --- a/gemfiles/rubocop.gemfile +++ b/gemfiles/rubocop.gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" do gem "rubocop-md", "~> 1.0" gem "standard", "~> 1.0" - gem "ruby-next", ">= 0.12.0" + gem "ruby-next", ">= 1.0" end diff --git a/test/action_policy/rails/controllers_test.rb b/test/action_policy/rails/controllers_test.rb index 05f08b9..0fe92f5 100644 --- a/test/action_policy/rails/controllers_test.rb +++ b/test/action_policy/rails/controllers_test.rb @@ -241,7 +241,7 @@ def index private def authorize! - super with: UserPolicy + super(with: UserPolicy) end def current_user