Skip to content

Commit

Permalink
Merge 5e7c0c6 into 883f42c
Browse files Browse the repository at this point in the history
  • Loading branch information
urkle committed May 10, 2022
2 parents 883f42c + 5e7c0c6 commit 32d9d8a
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 7 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/prs.yml
Expand Up @@ -16,14 +16,26 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: ['2.5', '2.6', '2.7', '3.0']
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
activesupport: ['5.2', '6.0', '6.1', '7.0']
exclude:
- ruby: '2.5'
activesupport: '7.0'
- ruby: '2.6'
activesupport: '7.0'
- ruby: '3.0'
activesupport: '5.2'
- ruby: '3.1'
activesupport: '5.2'
env:
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/Gemfile.activesupport-${{ matrix.activesupport }}"
steps:
- uses: actions/checkout@v2

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

- name: 'Run bundle update'
Expand All @@ -36,7 +48,7 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.ruby-version }}
flag-name: run-${{ matrix.ruby }}-${{ matrix.activesupport }}
parallel: true
finish:
needs: 'test'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
/.bundle/
/.yardoc
/Gemfile.lock
/gemfiles/*.lock
/_yardoc/
/coverage/
/doc/
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -5,4 +5,5 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in schema_dev.gemspec
gemspec

gem 'byebug'
gemfile_local = File.expand_path '../Gemfile.local', __FILE__
eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
4 changes: 4 additions & 0 deletions gemfiles/Gemfile.activesupport-5.2
@@ -0,0 +1,4 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile)

gem "activerecord", ">= 5.2.0.beta0", "< 5.3"
4 changes: 4 additions & 0 deletions gemfiles/Gemfile.activesupport-6.0
@@ -0,0 +1,4 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile)

gem "activerecord", ">= 6.0", "< 6.1"
4 changes: 4 additions & 0 deletions gemfiles/Gemfile.activesupport-6.1
@@ -0,0 +1,4 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile)

gem "activerecord", ">= 6.1", "< 6.2"
4 changes: 4 additions & 0 deletions gemfiles/Gemfile.activesupport-7.0
@@ -0,0 +1,4 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile)

gem "activerecord", ">= 7.0", "< 7.1"
4 changes: 4 additions & 0 deletions gemfiles/Gemfile.base
@@ -0,0 +1,4 @@
source 'https://rubygems.org'
gemspec path: File.expand_path('..', __FILE__)

File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
6 changes: 5 additions & 1 deletion lib/schema_dev/config.rb
Expand Up @@ -17,7 +17,11 @@ def self._reset
end

def self.read
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, [Symbol]).symbolize_keys)
if ::Gem::Version.new(RUBY_VERSION) >= ::Gem::Version.new('3.1')
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, permitted_classes: [Symbol], symbolize_names: true))
else
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, [Symbol], symbolize_names: true))
end
end

def self.load
Expand Down
2 changes: 1 addition & 1 deletion lib/schema_dev/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SchemaDev
VERSION = '4.1.1'
VERSION = '4.2.beta.2'
end
2 changes: 1 addition & 1 deletion schema_dev.gemspec
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = '>= 2.5.0'

gem.add_dependency 'activesupport', '>= 5.2', '< 6.2'
gem.add_dependency 'activesupport', '>= 5.2', '< 7.1'
gem.add_dependency 'faraday', '~> 1.0'
gem.add_dependency 'simplecov'
gem.add_dependency 'simplecov-lcov', '~> 0.8.0'
Expand Down
4 changes: 4 additions & 0 deletions templates/gemfiles/activerecord-7.0/Gemfile.base.erb
@@ -0,0 +1,4 @@
base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
eval File.read(base_gemfile)

gem "activerecord", ">= 7.0", "< 7.1"
10 changes: 10 additions & 0 deletions templates/gemfiles/activerecord-7.0/Gemfile.mysql2.erb
@@ -0,0 +1,10 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile), binding, base_gemfile

platform :ruby do
gem "mysql2"
end

platform :jruby do
gem 'activerecord-jdbcmysql-adapter'
end
10 changes: 10 additions & 0 deletions templates/gemfiles/activerecord-7.0/Gemfile.postgresql.erb
@@ -0,0 +1,10 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile), binding, base_gemfile

platform :ruby do
gem "pg"
end

platform :jruby do
gem 'activerecord-jdbcpostgresql-adapter'
end
10 changes: 10 additions & 0 deletions templates/gemfiles/activerecord-7.0/Gemfile.sqlite3.erb
@@ -0,0 +1,10 @@
base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
eval File.read(base_gemfile), binding, base_gemfile

platform :ruby do
gem "sqlite3"
end

platform :jruby do
gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
end

0 comments on commit 32d9d8a

Please sign in to comment.