Skip to content

Commit f56f2e1

Browse files
authored
feat: rewrite with clean api (#451)
release-as: 9.0.0
1 parent 1b07d5b commit f56f2e1

File tree

100 files changed

+2265
-2027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2265
-2027
lines changed

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copy this file to .env and update with your database connection strings
2+
3+
# PostgreSQL primary database
4+
DATABASE_URL_PG=postgresql://closure_tree:[email protected]:5434/closure_tree_test
5+
6+
# MySQL secondary database
7+
DATABASE_URL_MYSQL=mysql2://closure_tree:[email protected]:3367/closure_tree_test
8+
9+
# SQLite database (optional, in-memory by default)
10+
# DATABASE_URL_SQLITE3=sqlite3:closure_tree_test.db

.github/workflows/ci.yml

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: CI
32

43
on:
@@ -9,49 +8,49 @@ on:
98
branches:
109
- master
1110

12-
1311
jobs:
1412
test:
1513
runs-on: ubuntu-latest
14+
1615
services:
17-
mysql:
18-
image: mysql/mysql-server
19-
ports:
20-
- "3306:3306"
21-
env:
22-
MYSQL_ROOT_PASSWORD: root
23-
MYSQL_DATABASE: closure_tree_test
24-
MYSQL_ROOT_HOST: '%'
2516
postgres:
26-
image: 'postgres'
27-
ports: ['5432:5432']
17+
image: postgres:17-alpine
18+
ports:
19+
- 5432:5432
2820
env:
21+
POSTGRES_USER: postgres
2922
POSTGRES_PASSWORD: postgres
3023
POSTGRES_DB: closure_tree_test
3124
options: >-
3225
--health-cmd pg_isready
3326
--health-interval 10s
3427
--health-timeout 5s
3528
--health-retries 5
29+
30+
mysql:
31+
image: mysql:8
32+
ports:
33+
- 3306:3306
34+
env:
35+
MYSQL_DATABASE: closure_tree_test
36+
MYSQL_ROOT_PASSWORD: root
37+
options: >-
38+
--health-cmd="mysqladmin ping"
39+
--health-interval=10s
40+
--health-timeout=5s
41+
--health-retries=3
3642
3743
strategy:
3844
fail-fast: false
3945
matrix:
4046
ruby:
41-
- '3.3'
47+
- '3.4'
4248
rails:
43-
- activerecord_8.0
44-
- activerecord_7.2
45-
- activerecord_7.1
46-
- activerecord_edge
47-
adapter:
48-
- 'sqlite3:///:memory:'
49-
- mysql2://root:root@0/closure_tree_test
50-
- postgres://closure_tree:closure_tree@0/closure_tree_test
49+
- '8.0'
5150

5251
steps:
5352
- name: Checkout
54-
uses: actions/checkout@v3
53+
uses: actions/checkout@v4
5554

5655
- name: Setup Ruby
5756
uses: ruby/setup-ruby@v1
@@ -60,14 +59,25 @@ jobs:
6059
bundler-cache: true
6160
rubygems: latest
6261
env:
63-
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
62+
RAILS_VERSION: ${{ matrix.rails }}
63+
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile
64+
65+
- name: Setup databases
66+
env:
6467
RAILS_ENV: test
68+
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test
69+
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test
70+
DATABASE_URL_SQLITE3: 'sqlite3::memory:'
71+
run: |
72+
cd test/dummy
73+
bundle exec rails db:setup_all
6574
66-
- name: Test
75+
- name: Run tests
6776
env:
6877
RAILS_ENV: test
69-
RAILS_VERSION: ${{ matrix.rails }}
70-
DB_ADAPTER: ${{ matrix.adapter }}
71-
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
78+
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test
79+
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test
80+
DATABASE_URL_SQLITE3: 'sqlite3::memory:'
7281
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }}
73-
run: bin/rake
82+
run: |
83+
bundle exec rake test

.github/workflows/ci_jruby.yml

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

.github/workflows/ci_truffleruby.yml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pkg/
55
rdoc/
66
doc/
77
*.sqlite3.db
8+
*.sqlite3
89
*.log
910
tmp/
1011
.DS_Store

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
12
{".":"8.0.0"}

Appraisals

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

Gemfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,26 @@ source 'https://rubygems.org'
44

55
gemspec
66

7-
gem 'with_advisory_lock', github: 'closuretree/with_advisory_lock'
7+
gem 'dotenv'
8+
gem 'railties'
9+
gem 'with_advisory_lock', '>= 7'
10+
11+
gem 'activerecord', "~> #{ENV['RAILS_VERSION'] || '8.0'}"
12+
13+
platforms :mri, :truffleruby do
14+
# Database adapters
15+
gem 'mysql2'
16+
gem 'pg'
17+
gem 'sqlite3'
18+
end
19+
20+
# Testing gems
21+
group :test do
22+
gem 'maxitest'
23+
gem 'mocha'
24+
end
25+
26+
# Development gems
27+
group :development do
28+
gem 'rubocop', require: false
29+
end

0 commit comments

Comments
 (0)