Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f0342fd
Add log/*.log to .gitignore and remove development.log
takaokouji Nov 1, 2025
77c9da2
Add comprehensive coverage measurement with SimpleCov
takaokouji Oct 31, 2025
29e4e4f
Add Rails 7.1 compatibility (partial - 664/674 tests passing)
takaokouji Oct 31, 2025
e2f6441
Complete Rails 7.1.6 support with Rack 3.0 compatibility
takaokouji Oct 31, 2025
cda51a6
Complete Rails 7.2.3 support
takaokouji Nov 1, 2025
de5dfea
Complete Rails 8.0.4 support
takaokouji Nov 1, 2025
d277fc4
Add partial Rails 8.1.2 support (664/674 tests passing)
takaokouji Nov 1, 2025
85d6cce
Add complete Rails 8.1.2 support
takaokouji Nov 1, 2025
88e01a4
Fix Rails 5.2-6.1 compatibility in test_helper.rb
takaokouji Jan 20, 2026
93cf21f
Sync test_helper.rb compatibility fixes from docker-support
takaokouji Jan 20, 2026
878520c
Add Logger require for Ruby 2.6 compatibility
takaokouji Jan 20, 2026
01bdcd4
Fix unstable ordering in BookCommentResource for PostgreSQL
takaokouji Jan 20, 2026
0914344
Fix test_warn_on_joined_to_many for Ruby 2.7 with Rails 5.2
takaokouji Jan 20, 2026
2c4e452
Fix unstable ordering in Book associations for PostgreSQL
takaokouji Jan 20, 2026
013f87a
Update CI matrix for Ruby 3.3, 3.4 and Rails 6.1-8.1
takaokouji Jan 20, 2026
ae2e6af
Add csv gem dependency for Ruby 3.4+ support
takaokouji Jan 20, 2026
dbb5e1a
Add default_scope to BookComment for stable ordering
takaokouji Jan 20, 2026
7a7b80e
Merge pull request #9 from speee/rails-8.1-support-core
takaokouji Jan 20, 2026
3fbf28b
Add Docker support for multi-version Rails testing
takaokouji Jan 20, 2026
9783d74
Add Docker services for Rails 7.1-8.1 testing
takaokouji Jan 20, 2026
d51c6dd
Fix Docker command to remove Gemfile.lock before bundle install
takaokouji Jan 20, 2026
d4203e2
Add SQLite WAL mode files to .gitignore
takaokouji Jan 20, 2026
5ff7f95
Add Docker services for Rails 5.1, 5.2, and 6.0
takaokouji Jan 20, 2026
74294a5
Add Ruby 2.7 Dockerfile for Rails 5.1-6.0 compatibility
takaokouji Jan 20, 2026
44f9266
Fix bundler version for Ruby 2.7 compatibility
takaokouji Jan 20, 2026
5c90b83
Fix Psych::DisallowedClass error for Rails 6.0 with Ruby 2.7+
takaokouji Jan 20, 2026
d78b012
Change Rails 6.1-8.1 to use Ruby 3.1.5
takaokouji Jan 20, 2026
49d75c6
Use Ruby 3.1.5 for Rails 6.1-7.2, Ruby 3.4 for Rails 8.0-8.1
takaokouji Jan 20, 2026
37bad60
Merge pull request #10 from speee/docker-support-speee
takaokouji Jan 20, 2026
005a426
Fix Rails 8.2 deprecation warnings and improve Rack compatibility
takaokouji Jan 20, 2026
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
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Git
.git
.gitignore
.github

# Claude/AI configuration
.claude
.serena
CLAUDE.md

# Documentation
*.md
!README.md

# Test artifacts
coverage/
test_db
*.sqlite3
.last_run.json
.resultset.json

# Ruby/bundler
.bundle
vendor/bundle

# OS files
.DS_Store
Thumbs.db

# Editor files
.vscode
.idea
*.swp
*.swo
*~
64 changes: 61 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,94 @@ jobs:
- '3.0'
- 3.1
- 3.2
- 3.3
- 3.4
rails:
- 7.0.4
- 6.1.7
- 8.1.2
- 8.0.4
- 7.2.3
- 7.1.6
- 7.0.10
- 6.1.7.10
- 6.0.6
- 5.2.8.1
- 5.1.7
database_url:
- postgresql://postgres:password@localhost:5432/test
- sqlite3:test_db
exclude:
# Ruby 3.4 exclusions (Rails 7.2+)
- ruby: 3.4
rails: 7.1.6
- ruby: 3.4
rails: 7.0.10
- ruby: 3.4
rails: 6.1.7.10
- ruby: 3.4
rails: 6.0.6
- ruby: 3.4
rails: 5.2.8.1
- ruby: 3.4
rails: 5.1.7
# Ruby 3.3 exclusions (Rails 6.1+)
- ruby: 3.3
rails: 6.0.6
- ruby: 3.3
rails: 5.2.8.1
- ruby: 3.3
rails: 5.1.7
# Ruby 3.2 exclusions (Rails 7.0+)
- ruby: 3.2
rails: 6.0.6
- ruby: 3.2
rails: 5.2.8.1
- ruby: 3.2
rails: 5.1.7
# Ruby 3.1 exclusions (Rails 6.1+)
- ruby: 3.1
rails: 8.1.2
- ruby: 3.1
rails: 8.0.4
- ruby: 3.1
rails: 6.0.6
- ruby: 3.1
rails: 5.2.8.1
- ruby: 3.1
rails: 5.1.7
# Ruby 3.0 exclusions (Rails 6.1+)
- ruby: '3.0'
rails: 8.1.2
- ruby: '3.0'
rails: 8.0.4
- ruby: '3.0'
rails: 7.2.3
- ruby: '3.0'
rails: 6.0.6
- ruby: '3.0'
rails: 5.2.8.1
- ruby: '3.0'
rails: 5.1.7
# Ruby 2.7 exclusions (Rails 5.1-7.0)
- ruby: 2.7
rails: 8.1.2
- ruby: 2.7
rails: 8.0.4
- ruby: 2.7
rails: 7.2.3
- ruby: 2.7
rails: 7.1.6
# Ruby 2.6 exclusions (Rails 5.1-6.1)
- ruby: 2.6
rails: 8.1.2
- ruby: 2.6
rails: 8.0.4
- ruby: 2.6
rails: 7.2.3
- ruby: 2.6
rails: 7.1.6
- ruby: 2.6
rails: 7.0.4
rails: 7.0.10
# PostgreSQL not supported on Rails 5.1.7
- database_url: postgresql://postgres:password@localhost:5432/test
rails: 5.1.7
env:
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Gemfile.lock
InstalledFiles
_yardoc
coverage
coverage/
doc/
lib/bundler/man
pkg
Expand All @@ -17,9 +17,11 @@ spec/reports
test/tmp
test/version_tmp
tmp
coverage
test/log
log/*.log
test_db
test_db-journal
test/test_db-shm
test/test_db-wal
.idea
*.iml
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dockerfile for testing jsonapi-resources with multiple Rails versions

FROM ruby:3.2

# Install dependencies
RUN apt-get update -qq && \
apt-get install -y build-essential libpq-dev nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Gemfile and gemspec
COPY Gemfile jsonapi-resources.gemspec ./
COPY lib/jsonapi/resources/version.rb ./lib/jsonapi/resources/

# Install bundler
RUN gem install bundler

# Note: bundle install will happen at runtime with specific RAILS_VERSION
# This allows testing multiple Rails versions without rebuilding the image
22 changes: 22 additions & 0 deletions Dockerfile.ruby2.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dockerfile for testing jsonapi-resources with Rails 5.1-7.0 (Ruby 2.7)

FROM ruby:2.7

# Install dependencies
RUN apt-get update -qq && \
apt-get install -y build-essential libpq-dev nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Gemfile and gemspec
COPY Gemfile jsonapi-resources.gemspec ./
COPY lib/jsonapi/resources/version.rb ./lib/jsonapi/resources/

# Install bundler (Ruby 2.7 requires bundler < 2.5)
RUN gem install bundler -v 2.4.22

# Note: bundle install will happen at runtime with specific RAILS_VERSION
# This allows testing multiple Rails versions without rebuilding the image
24 changes: 24 additions & 0 deletions Dockerfile.ruby3.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dockerfile for testing jsonapi-resources with Rails 6.1-8.1 (Ruby 3.1.5)

FROM ruby:3.1.5

# Install dependencies
RUN apt-get update -qq && \
apt-get install -y build-essential libpq-dev nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Gemfile and gemspec
COPY Gemfile jsonapi-resources.gemspec ./
COPY lib/jsonapi/resources/version.rb ./lib/jsonapi/resources/

# Install specific bundler version for compatibility
RUN gem install bundler -v 2.4.14 --no-document && \
gem install bundler -v 2.4.14 --install-dir /usr/local/bundle --no-document && \
bundle --version

# Note: bundle install will happen at runtime with specific RAILS_VERSION
# This allows testing multiple Rails versions without rebuilding the image
24 changes: 24 additions & 0 deletions Dockerfile.ruby3.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dockerfile for testing jsonapi-resources with Rails 8.0-8.1 (Ruby 3.4)

FROM ruby:3.4

# Install dependencies
RUN apt-get update -qq && \
apt-get install -y build-essential libpq-dev nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Gemfile and gemspec
COPY Gemfile jsonapi-resources.gemspec ./
COPY lib/jsonapi/resources/version.rb ./lib/jsonapi/resources/

# Install specific bundler version for compatibility
RUN gem install bundler -v 2.4.14 --no-document && \
gem install bundler -v 2.4.14 --install-dir /usr/local/bundle --no-document && \
bundle --version

# Note: bundle install will happen at runtime with specific RAILS_VERSION
# This allows testing multiple Rails versions without rebuilding the image
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ platforms :ruby do

if version.start_with?('4.2', '5.0')
gem 'sqlite3', '~> 1.3.13'
elsif version.start_with?('8.')
# Rails 8.0+ requires sqlite3 >= 2.1
gem 'sqlite3', '>= 2.1'
else
gem 'sqlite3', '~> 1.4'
end
Expand Down
121 changes: 121 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
services:
# Base service definition for Ruby 3.1.5 (Rails 6.1-8.1)
test-base: &test-base
build:
context: .
dockerfile: Dockerfile.ruby3.1
volumes:
- .:/app
- bundle-cache-ruby31:/usr/local/bundle
working_dir: /app
stdin_open: true
tty: true

# Base service definition for Ruby 2.7 (Rails 5.1-6.0)
test-base-ruby27: &test-base-ruby27
build:
context: .
dockerfile: Dockerfile.ruby2.7
volumes:
- .:/app
- bundle-cache-ruby27:/usr/local/bundle
working_dir: /app
stdin_open: true
tty: true

# Base service definition for Ruby 3.4 (Rails 8.0-8.1)
test-base-ruby34: &test-base-ruby34
build:
context: .
dockerfile: Dockerfile.ruby3.4
volumes:
- .:/app
- bundle-cache-ruby34:/usr/local/bundle
working_dir: /app
stdin_open: true
tty: true

# Rails 5.1.7
rails-5.1:
<<: *test-base-ruby27
container_name: jsonapi-rails-5.1
environment:
- RAILS_VERSION=5.1.7
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"

# Rails 5.2.8.1
rails-5.2:
<<: *test-base-ruby27
container_name: jsonapi-rails-5.2
environment:
- RAILS_VERSION=5.2.8.1
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"

# Rails 6.0.6
rails-6.0:
<<: *test-base-ruby27
container_name: jsonapi-rails-6.0
environment:
- RAILS_VERSION=6.0.6
command: bash -c "rm -f Gemfile.lock && bundle install && bundle exec rake test"

# Rails 6.1.7.10
rails-6.1:
<<: *test-base
container_name: jsonapi-rails-6.1
environment:
- RAILS_VERSION=6.1.7.10
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Rails 7.0.10
rails-7.0:
<<: *test-base
container_name: jsonapi-rails-7.0
environment:
- RAILS_VERSION=7.0.10
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Rails 7.1.6
rails-7.1:
<<: *test-base
container_name: jsonapi-rails-7.1
environment:
- RAILS_VERSION=7.1.6
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Rails 7.2.3
rails-7.2:
<<: *test-base
container_name: jsonapi-rails-7.2
environment:
- RAILS_VERSION=7.2.3
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Rails 8.0.4 (Ruby 3.4 required)
rails-8.0:
<<: *test-base-ruby34
container_name: jsonapi-rails-8.0
environment:
- RAILS_VERSION=8.0.4
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Rails 8.1.2 (Ruby 3.4 required)
rails-8.1:
<<: *test-base-ruby34
container_name: jsonapi-rails-8.1
environment:
- RAILS_VERSION=8.1.2
command: bash -c "rm -f Gemfile.lock && /usr/local/bin/bundler _2.4.14_ install && /usr/local/bin/bundler _2.4.14_ exec rake test"

# Interactive shell for debugging (defaults to Rails 8.1)
shell:
<<: *test-base
container_name: jsonapi-shell
environment:
- RAILS_VERSION=${RAILS_VERSION:-8.1.2}
command: /bin/bash

volumes:
bundle-cache-ruby31:
bundle-cache-ruby27:
bundle-cache-ruby34:
1 change: 1 addition & 0 deletions jsonapi-resources.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
spec.add_dependency 'activerecord', '>= 5.1'
spec.add_dependency 'railties', '>= 5.1'
spec.add_dependency 'concurrent-ruby'
spec.add_dependency 'csv' # Required for Ruby 3.4+ (no longer a default gem)
end
Loading
Loading