Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ jobs:
run: bundle exec rubocop -P
- name: Check manifest
run: bundle exec rake manifest:check
- name: Check appraisals
run: bundle exec rake appraisal:check
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ Rails/ApplicationRecord:
Rails/BulkChangeTable:
Enabled: false

# Manifest tasks do not need environment
# Manifest and appraisal tasks do not need environment
Rails/RakeEnvironment:
Exclude:
- 'lib/tasks/manifest.rake'
- 'lib/tasks/appraisal.rake'

# Migrations should not do validations in general?
Rails/SkipsModelValidations:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gemspec

group :development, :test do
gem "appraisal", "~> 2.3"
gem "rspec-rails", "~> 8.0"
gem "rspec-rails", "~> 7.1"
gem "rubocop", "~> 1.91"
gem "rubocop-capybara", "~> 3.0"
gem "rubocop-factory_bot", "~> 2.28"
Expand Down
1 change: 1 addition & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ lib/publify_app/textfilter_code.rb
lib/publify_textfilter_code.rb
lib/publify_textfilter_code/engine.rb
lib/publify_textfilter_code/version.rb
lib/tasks/appraisal.rake
lib/tasks/manifest.rake
lib/tasks/publify_textfilter_code_tasks.rake
9 changes: 5 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ rescue LoadError
end

APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
load "rails/tasks/engine.rake"

require "rspec/core/rake_task"

load "rails/tasks/engine.rake"
load "rails/tasks/statistics.rake"
load "lib/tasks/manifest.rake"
load "lib/tasks/appraisal.rake"

Bundler::GemHelper.install_tasks

require "rspec/core/rake_task"

desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(spec: "app:db:test:prepare")
task default: :spec

load "lib/tasks/manifest.rake"
task default: "manifest:check"
15 changes: 15 additions & 0 deletions lib/tasks/appraisal.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

namespace :appraisal do
desc "Check appraisals"
task :check do
Appraisal::AppraisalFile.each do |appraisal|
existing = File.read(appraisal.gemfile_path)
signature = Appraisal::Customize.heading || "This file was generated by Appraisal"
header = appraisal.send :comment_lines, signature
body = appraisal.send :quoted_gemfile
expected = [header, body].join("\n\n")
raise "Outdated appraisal: #{appraisal.name}" unless existing.chomp == expected.chomp
end
end
end
Loading