forked from JackDanger/permanent_records
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest source version 6.0 (#9)
* bumping to 5.0.0 This includes support for Rails 5 and a better gem deployment mechanism * Pushing tags on release * testing automatic version tagging * Fixing EOL issue * Check If Record Has DeletedAt Column ## Context Previously, when model with has_many association without `deleted_at` column will raise "undefined method deleted_at=" error. With this change, it will revert to original destroy behavior when the record does not have `deleted_at` column. * Update version support: Rails >= 5.2, Ruby >= 2.7.8 Also introduce appraisal for multi-version testing * Fix rubocop offenses * Restrict to Rails < 7, minimize active record patch ... by delegating to super so we don't have to copy more of active record than necessary. * Add rubocop-rake and rubocop-rspec, fix more warnings Keep some warnings in rubocop todos for now, also disabled some cops in rubocop config that would definitely mean lots of rewriting ... to be examinated later. * Relax rails version constraint to include 7, add appraisals * Bump version to 6.0.0 * Try to fix gempush GH workflow Got error: "fatal: ambiguous argument 'HEAD..HEAD^': unknown revision or path not in the working tree." Also, make gempush-if-failed script fail on error. * Bump version to 6.0.1 --------- Co-authored-by: Jack Danger <[email protected]> Co-authored-by: Taufek Johar <[email protected]> Co-authored-by: Luciano Maiwald <[email protected]> Co-authored-by: Maximilian Herold <[email protected]>
- Loading branch information
1 parent
39583fe
commit 49f124d
Showing
46 changed files
with
468 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Lint & Test | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
ruby: | ||
- 2.7.8 | ||
- 3.0.6 | ||
- 3.1.4 | ||
- 3.2.3 | ||
appraisal: | ||
- rails-5.2 | ||
- rails-6.0 | ||
- rails-6.1 | ||
- rails-7.0 | ||
- rails-7.1 | ||
exclude: | ||
- ruby: 3.0.6 | ||
appraisal: rails-5.2 | ||
- ruby: 3.1.4 | ||
appraisal: rails-5.2 | ||
- ruby: 3.2.3 | ||
appraisal: rails-5.2 | ||
steps: | ||
- name: Install system dependencies | ||
run: sudo apt-get install -y libsqlite3-dev | ||
- uses: actions/checkout@master | ||
- name: Setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- name: Install bundle | ||
run: bundle | ||
- name: Install appraisal | ||
run: bundle exec appraisal install | ||
- name: Run tests | ||
run: bundle exec appraisal ${{ matrix.appraisal }} rspec | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install system dependencies | ||
run: sudo apt-get install -y libsqlite3-dev | ||
- uses: actions/checkout@master | ||
- name: Setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.8 | ||
- name: Install bundle | ||
run: bundle | ||
- name: Run rubocop | ||
run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
require: rubocop-performance | ||
require: | ||
- rubocop-performance | ||
- rubocop-rake | ||
- rubocop-rspec | ||
|
||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
Exclude: | ||
- bin/* | ||
TargetRubyVersion: 2.2 | ||
- gemfiles/* | ||
- vendor/bundle/**/* | ||
NewCops: enable | ||
TargetRubyVersion: 2.7 | ||
|
||
Gemspec/RequireMFA: | ||
Exclude: | ||
- 'permanent_records.gemspec' | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
Layout/LineLength: | ||
Max: 120 | ||
|
||
RSpec/ContextWording: | ||
Enabled: false | ||
|
||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
|
||
RSpec/MultipleMemoizedHelpers: | ||
Enabled: false | ||
|
||
RSpec/NestedGroups: | ||
Enabled: false | ||
|
||
Style/BlockDelimiters: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,65 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2019-10-15 13:32:11 +0200 using RuboCop version 0.68.1. | ||
# on 2024-03-26 14:12:23 UTC using RuboCop version 1.62.1. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 11 | ||
RSpec/AnyInstance: | ||
Exclude: | ||
- 'spec/permanent_records_spec.rb' | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: CountAsOne. | ||
RSpec/ExampleLength: | ||
Max: 22 | ||
|
||
# Offense count: 5 | ||
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. | ||
# Include: **/*_spec*rb*, **/spec/**/* | ||
RSpec/FilePath: | ||
Exclude: | ||
- 'spec/permanent_records/circular_sti_dependency_spec.rb' | ||
- 'spec/permanent_records/counter_cache_spec.rb' | ||
- 'spec/permanent_records/propagate_validation_flag_spec.rb' | ||
- 'spec/permanent_records/revive_parent_first_spec.rb' | ||
- 'spec/permanent_records/validate_presence_spec.rb' | ||
|
||
# Offense count: 5 | ||
RSpec/LetSetup: | ||
Exclude: | ||
- 'spec/permanent_records/revive_parent_first_spec.rb' | ||
- 'spec/permanent_records_spec.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: . | ||
# SupportedStyles: have_received, receive | ||
RSpec/MessageSpies: | ||
EnforcedStyle: receive | ||
|
||
# Offense count: 60 | ||
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. | ||
# SupportedStyles: always, named_only | ||
RSpec/NamedSubject: | ||
Exclude: | ||
- 'spec/permanent_records_spec.rb' | ||
|
||
# Offense count: 5 | ||
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata. | ||
# Include: **/*_spec.rb | ||
RSpec/SpecFilePathFormat: | ||
Exclude: | ||
- '**/spec/routing/**/*' | ||
- 'spec/permanent_records/circular_sti_dependency_spec.rb' | ||
- 'spec/permanent_records/counter_cache_spec.rb' | ||
- 'spec/permanent_records/propagate_validation_flag_spec.rb' | ||
- 'spec/permanent_records/revive_parent_first_spec.rb' | ||
- 'spec/permanent_records/validate_presence_spec.rb' | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Rake/Desc: | ||
Exclude: | ||
- 'Rakefile' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
appraise 'rails-5.2' do | ||
gem 'rails', '5.2.8.1' | ||
end | ||
|
||
appraise 'rails-6.0' do | ||
gem 'rails', '6.0.6.1' | ||
end | ||
|
||
appraise 'rails-6.1' do | ||
gem 'rails', '6.1.7.7' | ||
end | ||
|
||
appraise 'rails-7.0' do | ||
gem 'rails', '7.0.8.1' | ||
end | ||
|
||
appraise 'rails-7.1' do | ||
gem 'rails', '7.1.3.2' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
gem 'appraisal' | ||
gem 'database_cleaner', '>= 1.5.1' | ||
gem 'pry-byebug' | ||
gem 'rake' | ||
gem 'rspec', '>= 3.5.0' | ||
gem 'rubocop' | ||
gem 'rubocop-performance' | ||
gem 'rubocop-rake' | ||
gem 'rubocop-rspec' | ||
gem 'sqlite3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler' | ||
require 'yaml' | ||
require 'English' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.2.8 | ||
6.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -euo pipefail | ||
if git diff --name-only HEAD..HEAD^ | egrep -q '^VERSION$'; then | ||
# The VERSION file changed in the last commit, build the gem and push | ||
gem build *.gemspec | ||
gem push *.gem | ||
|
||
# We set the GITHUB_TOKEN variable from the repo's 'Secrets' admin panel. | ||
git remote set-url --push origin https://JackDanger:${GITHUB_TOKEN}@github.com/JackDanger/permanent_records.git | ||
|
||
version=$(cat VERSION) | ||
git tag ${version} | ||
git push origin ${version} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "database_cleaner", ">= 1.5.1" | ||
gem "pry-byebug" | ||
gem "rake" | ||
gem "rspec", ">= 3.5.0" | ||
gem "rubocop" | ||
gem "rubocop-performance" | ||
gem "rubocop-rake" | ||
gem "rubocop-rspec" | ||
gem "sqlite3" | ||
gem "rails", "5.2.8.1" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "database_cleaner", ">= 1.5.1" | ||
gem "pry-byebug" | ||
gem "rake" | ||
gem "rspec", ">= 3.5.0" | ||
gem "rubocop" | ||
gem "rubocop-performance" | ||
gem "rubocop-rake" | ||
gem "rubocop-rspec" | ||
gem "sqlite3" | ||
gem "rails", "6.0.6.1" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "database_cleaner", ">= 1.5.1" | ||
gem "pry-byebug" | ||
gem "rake" | ||
gem "rspec", ">= 3.5.0" | ||
gem "rubocop" | ||
gem "rubocop-performance" | ||
gem "rubocop-rake" | ||
gem "rubocop-rspec" | ||
gem "sqlite3" | ||
gem "rails", "6.1.7.7" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "database_cleaner", ">= 1.5.1" | ||
gem "pry-byebug" | ||
gem "rake" | ||
gem "rspec", ">= 3.5.0" | ||
gem "rubocop" | ||
gem "rubocop-performance" | ||
gem "rubocop-rake" | ||
gem "rubocop-rspec" | ||
gem "sqlite3" | ||
gem "rails", "7.0.8.1" | ||
|
||
gemspec path: "../" |
Oops, something went wrong.