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
7 changes: 5 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 3.2
TargetRailsVersion: 7.1
TargetRailsVersion: 7.2
NewCops: enable
Exclude:
- bin/*
Expand All @@ -25,7 +25,6 @@ AllCops:
- gemfiles/vendor/bundle/**/*
- vendor/bundle/**/*
- Guardfile
- Rakefile
- vendor/**/*

Layout/LineLength:
Expand Down Expand Up @@ -73,6 +72,10 @@ Rails/ApplicationRecord:
Exclude:
- "demo/db/migrate/**"

Rails/RakeEnvironment:
Exclude:
- "Rakefile"

Rails/RefuteMethods:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# yarn lockfile v1


lastUpdateCheck 1761786460258
lastUpdateCheck 1762373771610
38 changes: 18 additions & 20 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
begin
require 'bundler/setup'

require 'bundler/gem_tasks'
require "bundler/setup"
require "bundler/gem_tasks"
require "minitest/test_task"
require 'rdoc/task'
require 'rubocop/rake_task'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
require "rdoc/task"
require "rubocop/rake_task"
rescue LoadError => e
puts "You must run `bundle install` to run rake tasks (#{e.message})"
end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'BootstrapForm'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_dir = "rdoc"
rdoc.title = "BootstrapForm"
rdoc.options << "--line-numbers"
rdoc.rdoc_files.include("README.md")
rdoc.rdoc_files.include("lib/**/*.rb")
end

Minitest::TestTask.create(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.warning = false
t.warning = true
t.test_globs = ["test/**/*_test.rb"]
end

desc 'Run RuboCop checks'
desc "Run RuboCop checks"
RuboCop::RakeTask.new(:rubocop)

task default: %i[test rubocop:autocorrect]

namespace :test do
desc "Run tests for all supported Rails versions, with current Ruby version"
task :all do
original_gemfile = ENV["BUNDLE_GEMFILE"]
original_gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
gemfiles = Dir.glob("gemfiles/*.gemfile").reject { |f| File.basename(f) == "common.gemfile" }
gemfiles.each do |f|
ENV["BUNDLE_GEMFILE"] = f
system("bundle update --bundler")
system("bundle check") || system("bundle install")
system("bundle exec rake test")
system("rake test")
end

original_directory = Dir.pwd
Dir.chdir("demo")
ENV.delete("BUNDLE_GEMFILE")
system("bundle update --bundler")
system("bundle check") || system("bundle install")
system("bundle exec rake test:all")

system("rake test:all")
ensure
original_gemfile.nil? ? ENV.delete("BUNDLE_GEMFILE") : ENV["BUNDLE_GEMFILE"] = original_gemfile
Dir.chdir(original_directory) unless original_directory.nil?
Expand Down
4 changes: 2 additions & 2 deletions demo/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ gem "sqlite3", ">= 2.1"
gem "stimulus-rails"
gem "thruster", require: false
gem "turbo-rails"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
gem "tzinfo-data", platforms: %i[windows jruby]

group :development, :test do
gem "brakeman", require: false
gem "debug", platforms: %i[mri mingw x64_mingw]
gem "debug", platforms: %i[mri windows]
end

group :development do
Expand Down
2 changes: 1 addition & 1 deletion demo/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,4 @@ DEPENDENCIES
web-console

BUNDLED WITH
2.5.9
2.7.2
1 change: 1 addition & 0 deletions gemfiles/common.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ end
group :development, :test do
gem "debug"
gem "ostruct" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.5.0")
gem "warning"
end

group :ci do
Expand Down
7 changes: 7 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
ENV["RAILS_ENV"] ||= "test"

puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop/ignore Rails/Output

require "warning"
mail_gem_path = Gem::Specification.find_by_name("mail").full_gem_path
Warning.ignore(:not_reached, mail_gem_path)
Warning.ignore(/warning: assigned but unused variable - testEof/, mail_gem_path)

require "diffy"
require "nokogiri"
require "equivalent-xml"
Expand Down