Skip to content

Commit

Permalink
Support pg 1.5 and Rails 7.1, 7.2 and 8.0 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-thatch authored Nov 29, 2024
1 parent f812c4d commit 36d577e
Show file tree
Hide file tree
Showing 28 changed files with 209 additions and 30 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ jobs:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- name: Install dependencies
run: bundle install
bundler-cache: true

- name: Run linter
run: bash -c "bundle exec rake standard"
run: bundle exec rake standard
27 changes: 8 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,31 @@ jobs:
fail-fast: false
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
- '2.5'

runs-on: ubuntu-latest

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gem-
- name: Install dependencies
run: |
gem update --system
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec appraisal install
bundler-cache: true

- name: Setup DB
run: cp spec/database.yml.sample spec/database.yml

- name: Install dependencies
run: bundle exec appraisal install

- name: Run tests
run: bundle exec appraisal rake spec
run: bundle exec appraisal rake spec
3 changes: 3 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ parallel: true
format: progress
ruby_version: 2.7.6
default_ignores: false

ignore:
- 'vendor/**/*'
15 changes: 14 additions & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def add_appraise_for(activerecord_version:, pg_version:)
end
end

SUPPORTED_PG_VERSIONS = ["~> 1.0", "~> 1.1", "~> 1.2", "~> 1.3", "~> 1.4"]
SUPPORTED_PG_VERSIONS = ["~> 1.0", "~> 1.1", "~> 1.2", "~> 1.3", "~> 1.4", "~> 1.5"]

if RUBY_VERSION <= "3.0"
SUPPORTED_PG_VERSIONS.map do |pg_version|
Expand All @@ -25,5 +25,18 @@ end
if RUBY_VERSION >= "2.7"
SUPPORTED_PG_VERSIONS.map do |pg_version|
add_appraise_for(activerecord_version: "~> 7.0", pg_version: pg_version)
add_appraise_for(activerecord_version: "~> 7.1", pg_version: pg_version)
end
end

if RUBY_VERSION >= "3.1"
SUPPORTED_PG_VERSIONS.map do |pg_version|
add_appraise_for(activerecord_version: "~> 7.2", pg_version: pg_version)
end
end

if RUBY_VERSION >= "3.2"
SUPPORTED_PG_VERSIONS.map do |pg_version|
add_appraise_for(activerecord_version: "~> 8.0", pg_version: pg_version)
end
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Or install it yourself as:

## Required

* **_Ruby_** >= 2.0
* **_Rails_** >= 5.2, < 8
* **_Ruby_** >= 2.7
* **_Rails_** >= 5.2, < 9
* **_Pg adapter (gem 'pg')_** >= 1.0, < 2

## How to use
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/activerecord_52_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 5.2", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_60_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 6.0", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_61_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 6.1", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_70_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.0", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.0"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_11.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.1"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_12.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.2"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_13.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.3"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_14.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.4"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_71_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.1", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.0"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_11.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.1"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_12.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.2"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_13.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.3"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_14.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.4"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_72_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 7.2", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.0"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_11.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.1"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_12.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.2"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_13.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.3"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_14.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.4"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/activerecord_80_pg_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 8.0", require: "active_record"
gem "pg", "~> 1.5"

gemspec path: "../"
6 changes: 3 additions & 3 deletions pg_ltree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Gem::Specification.new do |s|
s.summary = "Organize ActiveRecord model into a tree structure using PostgreSQL LTree"
s.description = "Organize ActiveRecord model into a tree structure using PostgreSQL LTree"
s.license = "MIT"
s.required_ruby_version = ">= 2.0.0"
s.required_ruby_version = ">= 2.7.0"

s.files = Dir["{lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]

s.add_dependency "activerecord", ">= 5.2", "< 8.0"
s.add_dependency "activerecord", ">= 5.2", "< 9.0"
s.add_dependency "pg", ">= 0.19", "< 2"

s.add_development_dependency "bundler"
s.add_development_dependency "rake"
s.add_development_dependency "pry"
s.add_development_dependency "standard"
s.add_development_dependency "yard", "~> 0.9.28"
s.add_development_dependency "appraisal", "~> 2.4"
s.add_development_dependency "appraisal", "~> 2.5"
s.add_development_dependency "rspec", "~> 3.11"
s.add_development_dependency "database_cleaner", "~> 2.0"
end

0 comments on commit 36d577e

Please sign in to comment.