Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Guntharp authored Oct 11, 2024
2 parents 9852944 + 7bb97d0 commit 6169a6a
Show file tree
Hide file tree
Showing 154 changed files with 922 additions and 2,367 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Tests

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- 'master'

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby:
- 2.5.7
- 2.6.5
gemfile:
- gemfiles/rails_4.2.2_paper_trail_3.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_3.0_will_paginate.gemfile
- gemfiles/rails_4.2.2_paper_trail_4.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_4.0_will_paginate.gemfile
- gemfiles/rails_4.2.2_paper_trail_5.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_5.0_will_paginate.gemfile
- gemfiles/rails_4.2.2_paper_trail_6.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_6.0_will_paginate.gemfile
- gemfiles/rails_4.2.2_paper_trail_7.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_7.0_will_paginate.gemfile
- gemfiles/rails_4.2.2_paper_trail_8.0_kaminari.gemfile
- gemfiles/rails_4.2.2_paper_trail_8.0_will_paginate.gemfile
- gemfiles/rails_5.0.0_paper_trail_5.0_kaminari.gemfile
- gemfiles/rails_5.0.0_paper_trail_5.0_will_paginate.gemfile
- gemfiles/rails_5.0.0_paper_trail_6.0_kaminari.gemfile
- gemfiles/rails_5.0.0_paper_trail_6.0_will_paginate.gemfile
- gemfiles/rails_5.0.0_paper_trail_7.0_kaminari.gemfile
- gemfiles/rails_5.0.0_paper_trail_7.0_will_paginate.gemfile
- gemfiles/rails_5.0.0_paper_trail_8.0_kaminari.gemfile
- gemfiles/rails_5.0.0_paper_trail_8.0_will_paginate.gemfile
- gemfiles/rails_5.1.0_paper_trail_10.0_kaminari.gemfile
- gemfiles/rails_5.1.0_paper_trail_10.0_will_paginate.gemfile
- gemfiles/rails_5.1.0_paper_trail_7.0_kaminari.gemfile
- gemfiles/rails_5.1.0_paper_trail_7.0_will_paginate.gemfile
- gemfiles/rails_5.1.0_paper_trail_8.0_kaminari.gemfile
- gemfiles/rails_5.1.0_paper_trail_8.0_will_paginate.gemfile
- gemfiles/rails_5.1.0_paper_trail_9.0_kaminari.gemfile
- gemfiles/rails_5.1.0_paper_trail_9.0_will_paginate.gemfile
- gemfiles/rails_5.2.0_paper_trail_10.0_kaminari.gemfile
- gemfiles/rails_5.2.0_paper_trail_10.0_will_paginate.gemfile
- gemfiles/rails_5.2.0_paper_trail_9.0_kaminari.gemfile
- gemfiles/rails_5.2.0_paper_trail_9.0_will_paginate.gemfile
- gemfiles/rails_6.0.0_paper_trail_10.0_kaminari.gemfile
- gemfiles/rails_6.0.0_paper_trail_10.0_will_paginate.gemfile

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

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby}}-gems-${{ hashFiles('**/paper_trail_manager.gemspec') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
gem install bundler -v $BUNDLER_VERSION
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Generate host app for testing
run: bundle exec rake generate_spec_app
- name: Run RSpec
run: |
bundle exec rake spec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Gemfile.lock
*.a
mkmf.log
*.gemfile.lock
spec/dummy
33 changes: 33 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'spec/dummy/**/*'

Rails:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Layout/LineLength:
Max: 120

RSpec/NestedGroups:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false

Metrics/BlockLength:
Enabled: false
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

35 changes: 23 additions & 12 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
RAILS_VERSIONS = ["3.2.0", "4.0.0", "4.1.0", "4.2.2"]
PAPER_TRAIL_VERSIONS = ["3.0", "4.0"]
# frozen_string_literal: true

RAILS_VERSIONS.each do |rails_version|
PAPER_TRAIL_VERSIONS.each do |paper_trail_version|
{
'4.2.2' => %w[3.0 4.0 5.0 6.0 7.0 8.0],
'5.0.0' => %w[5.0 6.0 7.0 8.0],
'5.1.0' => %w[7.0 8.0 9.0 10.0],
'5.2.0' => %w[9.0 10.0],
'6.0.0' => %w[10.0]
}.each do |rails_version, paper_trail_versions|
paper_trail_versions.each do |paper_trail_version|
appraise "rails-#{rails_version}-paper_trail-#{paper_trail_version}-will-paginate" do
gem "rails", "~> #{rails_version}"
gem "paper_trail", "~> #{paper_trail_version}"
gem "will_paginate", "~> 3.0"
gem "test-unit", "~> 3.0" if rails_version == "3.2.0"
gem 'rails', "~> #{rails_version}"
gem 'jquery-rails'
gem 'sqlite3', rails_version == '6.0.0' ? '~> 1.4' : '~> 1.3.6'
gem 'paper_trail', "~> #{paper_trail_version}"
gem 'will_paginate', '~> 3.0'

gem 'webpacker' if rails_version == '6.0.0'
end

appraise "rails-#{rails_version}-paper_trail-#{paper_trail_version}-kaminari" do
gem "rails", "~> #{rails_version}"
gem "paper_trail", "~> #{paper_trail_version}"
gem "kaminari", "~> 0.16"
gem "test-unit", "~> 3.0" if rails_version == "3.2.0"
gem 'rails', "~> #{rails_version}"
gem 'jquery-rails'
gem 'sqlite3', rails_version == '6.0.0' ? '~> 1.4' : '~> 1.3.6'
gem 'paper_trail', "~> #{paper_trail_version}"
gem 'kaminari', '>= 0.16'

gem 'webpacker' if rails_version == '6.0.0'
end
end
end
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes to `paper_trail_manager`
================================

* 0.7.0
* Add support for Rails 5 and 6
* Add support for paper_trail 5.x – 10.x
* Drop support for Rails < 4.1
* Drop support for Ruby < 2.5

* 0.6.0
* Add support for linking changes to user records via `PaperTrailManager.whodunnit_name_method` and `PaperTrailManager.user_path_method`
* Add new `PaperTrailManager.item_name_method` configuration option
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in paper_trail_manager.gemspec
gemspec

22 changes: 17 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# encoding: UTF-8
# frozen_string_literal: true

require 'rubygems'

require "bundler/gem_tasks"
require 'bundler/gem_tasks'
Bundler::GemHelper.install_tasks
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

app_rakefile_path = File.expand_path('spec/dummy/Rakefile', __dir__)

if File.exist?(app_rakefile_path)
APP_RAKEFILE = app_rakefile_path
load 'rails/tasks/engine.rake'
end

require 'rake'
require 'rdoc/task'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :default => ["db:create", "db:migrate", "spec"]
task default: ['db:create', 'db:migrate', 'spec']

Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
Expand All @@ -22,3 +27,10 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

task :generate_spec_app do
sh 'rm -rf spec/dummy'
sh 'rails new spec/dummy --skip-bootsnap --skip-bundle --skip-yarn \
--skip-git --skip-action-mailer --skip-puma --skip-test --skip-coffee \
--skip-spring --skip-listen --skip-turbolinks \
--template=spec/app_template.rb'
end
Loading

0 comments on commit 6169a6a

Please sign in to comment.