Skip to content
Open
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: 0 additions & 1 deletion .config/cucumber.yml

This file was deleted.

164 changes: 25 additions & 139 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

permissions:
contents: read
Expand All @@ -15,128 +15,35 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby-version: ['3.1']
gemfile: [rails_6.1]
postgres-version: ['12']

include:
- ruby-version: '2.1'
gemfile: rails_3.2
postgres-version: 10
- ruby-version: '2.1'
gemfile: rails_4.0
postgres-version: 10
- ruby-version: '2.1'
gemfile: rails_4.1
postgres-version: 10
- ruby-version: '2.1'
gemfile: rails_4.2
postgres-version: 12

- ruby-version: '2.2'
gemfile: rails_3.2
postgres-version: 10
- ruby-version: '2.2'
gemfile: rails_4.0
postgres-version: 10
- ruby-version: '2.2'
gemfile: rails_4.1
postgres-version: 10
- ruby-version: '2.2'
gemfile: rails_4.2
postgres-version: 12
- ruby-version: '2.2'
gemfile: rails_5.0
postgres-version: 12
- ruby-version: '2.2'
gemfile: rails_5.1
postgres-version: 12
- ruby-version: '2.2'
gemfile: rails_5.2
postgres-version: 12

- ruby-version: '2.3'
gemfile: rails_3.2
postgres-version: 10
- ruby-version: '2.3'
gemfile: rails_4.2
postgres-version: 12
- ruby-version: '2.3'
gemfile: rails_5.0
postgres-version: 12
- ruby-version: '2.3'
gemfile: rails_5.1
postgres-version: 12
- ruby-version: '2.3'
gemfile: rails_5.2
postgres-version: 12

- ruby-version: '2.4'
gemfile: rails_4.2
postgres-version: 12
- ruby-version: '2.4'
gemfile: rails_5.0
postgres-version: 12
- ruby-version: '2.4'
gemfile: rails_5.1
postgres-version: 12
- ruby-version: '2.4'
gemfile: rails_5.2
postgres-version: 12

- ruby-version: '2.5'
gemfile: rails_5.0
postgres-version: 12
- ruby-version: '2.5'
gemfile: rails_5.1
postgres-version: 12
- ruby-version: '2.5'
gemfile: rails_5.2
postgres-version: 12
- ruby-version: '2.5'
gemfile: rails_6.0
postgres-version: 12
- ruby-version: '2.5'
gemfile: rails_6.1
postgres-version: 12

- ruby-version: '2.6'
gemfile: rails_5.0
postgres-version: 12
- ruby-version: '2.6'
gemfile: rails_5.1
postgres-version: 12
- ruby-version: '2.6'
gemfile: rails_5.2
postgres-version: 12
- ruby-version: '2.6'
gemfile: rails_6.0
postgres-version: 12
- ruby-version: '2.6'
gemfile: rails_6.1
postgres-version: 12

- ruby-version: '2.7'
gemfile: rails_5.2
postgres-version: 12
- ruby-version: '2.7'
gemfile: rails_6.0
postgres-version: 12
- ruby-version: '2.7'
gemfile: rails_6.1
postgres-version: 12

- ruby-version: '3.0'
gemfile: rails_6.0
postgres-version: 12
- ruby-version: '3.0'
gemfile: rails_6.1
postgres-version: 12
- ruby-version: '3.2'
gemfile: rails_7.2
postgres-version: 16
- ruby-version: '3.2'
gemfile: rails_8.0
postgres-version: 16

- ruby-version: '3.3'
gemfile: rails_8.0
postgres-version: 16
- ruby-version: '3.3'
gemfile: rails_8.1
postgres-version: 16

- ruby-version: '3.4'
gemfile: rails_8.1
postgres-version: 16

- ruby-version: '4.0'
gemfile: rails_8.1
postgres-version: 16

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
EACO_AR_CONFIG: ./features/active_record.github.yml
CUCUMBER_PUBLISH_QUIET: "true"

steps:
- uses: actions/checkout@v6
Expand All @@ -146,32 +53,11 @@ jobs:
postgres-version: ${{ matrix.postgres-version }}
database: eaco

- name: Decide RubyGems
id: setup-params
run: |
rv="${{ matrix.ruby-version }}"
gf="${{ matrix.gemfile }}"

# Default RubyGems
rubygems=default

# Only for:
# - Ruby 2.3 + rails_3.2
# - Ruby 2.3 + rails_4.2
# - Ruby 2.4 + rails_4.2
if { [ "$rv" = "2.3" ] && { [ "$gf" = "rails_3.2" ] || [ "$gf" = "rails_4.2" ]; }; } ||
{ [ "$rv" = "2.4" ] && [ "$gf" = "rails_4.2" ]; }; then
rubygems=2.7.11
fi

echo "version=$rubygems" >> "$GITHUB_OUTPUT"

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
rubygems: ${{ steps.setup-params.outputs.version }}

- name: Run Specs
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

# Publishes the gem to RubyGems when a version tag is pushed, using RubyGems
# Trusted Publishing (OIDC) — no API key stored in repository secrets.
#
# One-time setup on rubygems.org: add this repository and the `release.yml`
# workflow as a trusted publisher for the `eaco` gem.
# https://guides.rubygems.org/trusted-publishing/
#
# To cut a release: bump Eaco::VERSION, update CHANGELOG.md, then
# git tag v2.0.0.beta1 && git push origin v2.0.0.beta1

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
release:
runs-on: ubuntu-latest
environment: release

permissions:
contents: write # create the GitHub Release
id-token: write # exchange the OIDC token with RubyGems

steps:
- uses: actions/checkout@v6

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true

- name: Build and push gem to RubyGems
uses: rubygems/release-gem@v1
1 change: 0 additions & 1 deletion .yardopts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
--private
--no-private
--hide-void-return
--plugin cucumber
'{lib,features}/**/*.rb' - README.md LICENSE.txt
67 changes: 6 additions & 61 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,66 +1,11 @@
appraise 'rails-3.2' do
gem 'rails', '~> 3.2.0'
gem 'pg', '~> 0.21'
gem 'activerecord-postgres-json'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-4.0' do
gem 'rails', '~> 4.0.0'
gem 'pg', '~> 0.21'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-4.1' do
gem 'rails', '~> 4.1.0'
gem 'pg', '~> 0.21'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-4.2' do
gem 'bigdecimal', '< 2'
gem 'loofah', '~> 2.20.0'
gem 'rails', '~> 4.2.0'
gem 'pg', '~> 0.21'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-5.0' do
gem 'loofah', '~> 2.20.0'
gem 'rails', '~> 5.0.0'
gem 'pg', '~> 0.21'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-5.1' do
gem 'loofah', '~> 2.20.0'
gem 'rails', '~> 5.1.0'
gem 'pg', '~> 0.21'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-5.2' do
gem 'loofah', '~> 2.20.0'
gem 'rails', '~> 5.2.0'
gem 'term-ansicolor', '~> 1.7.0'
end

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
appraise 'rails-7.2' do
gem 'rails', '~> 7.2.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
appraise 'rails-8.0' do
gem 'rails', '~> 8.0.0'
end

appraise 'rails-7.2' do
gem 'rails', '~> 7.2.0'
appraise 'rails-8.1' do
gem 'rails', '~> 8.1.0'
end
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,57 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
project adheres to [Semantic Versioning](https://semver.org/)

## Unreleased
## Unreleased (2.0.0.beta1)

### Changed
* **Gem renamed to `eaco-abac`** — a maintained continuation of `eaco`
(last released 1.1.1, 2017, by ifad). The require path, `Eaco` namespace
and DSL are unchanged: use `gem "eaco-abac", require: "eaco"`. Project
home is now https://github.com/iamaestimo/eaco.

### Added
* Active Record compatibility modules for Rails 7.0, 7.1, 7.2, 8.0 and 8.1
(`V70`–`V81`). The adapter previously rejected any Active Record newer than
6.1 with "Unsupported Active Record version".

### Changed
* Replaced `coveralls` (unmaintained) with plain `SimpleCov` for coverage.
Removed the dead Travis-only coverage-upload path from the default Rake task.
* Modernized the Railtie: use `config.enable_reloading` instead of the
deprecated `config.cache_classes`, and drop the pre-7.x reloader fallback.
* Added `# frozen_string_literal: true` to all of `lib/`.
* Added a `Release` GitHub Actions workflow that publishes the gem on version
tags via RubyGems Trusted Publishing (OIDC, no stored API key).
* Upgraded Cucumber from 3.2.0 to 11.x. Dropped the unmaintained
`yard-cucumber` plugin (pinned `cucumber < 4`) and its `--plugin cucumber`
entry in `.yardopts`. No step-definition changes were required. CI sets
`CUCUMBER_PUBLISH_QUIET` to silence the report-publishing banner.
* **Modernization (Phase 1):** dropped support for Rails < 7.2 and Ruby < 3.2.
* Supported matrix is now Ruby 3.2–4.0 against Rails 7.2, 8.0 and 8.1.
Full suite (RSpec + Cucumber) is green on Ruby 4.0 against all three.
* Trimmed `Appraisals` and `gemfiles/` to the supported Rails versions; added
`gemfiles/rails_8.0.gemfile` and `gemfiles/rails_8.1.gemfile`.
* CI now tests Ruby 3.2/3.3/3.4/4.0 and triggers on the `main` branch.
* Set `required_ruby_version >= 3.2` and added gem metadata.
* Added `ostruct` as a development dependency (no longer a default gem on
Ruby 3.5/4.0; required by Cucumber).

### Fixed
* Zeitwerk compatibility: the Railtie now parses `config/authorization.rb`
from a `to_prepare` block instead of directly in the initializer.
Application models cannot be autoloaded while Rails is booting on Rails 7+,
so any rules file referencing a model made the app fail to boot with
`NameError`. Rules are still re-parsed on each code reload in development.
Validated end-to-end inside a freshly generated Rails 8.1 app.
* `rails db:create` no longer crashes in apps using the `:pg_jsonb` adapter:
the ACL schema validation is skipped when the database is unreachable or
does not exist yet, instead of propagating `ActiveRecord::NoDatabaseError`.
* Ruby 3.4+ compatibility in specs: `Eaco::ACL#inspect` / `#pretty_inspect`
expectations now track Ruby's own `Hash` formatting (spaces around `=>`).
* Ruby 4.0 (Prism parser) compatibility: relaxed the `SyntaxError` message
expectation in the authorization-parse-error feature.
* Removed `.config/cucumber.yml`: Cucumber 3.x cannot parse profiles via the
removed `ERB.new` positional API on Ruby 3.4+.

### Fixed
* Fix YARD documentation warnings:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in eaco.gemspec
# Specify your gem's dependencies in eaco-abac.gemspec
gemspec
Loading