diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 19a20764d5..7ed367cc90 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -65,6 +65,7 @@ jobs: - "7.0" - "7.1" - "7.2" + - "main" ruby: - "3.1" - "3.2" diff --git a/Gemfile b/Gemfile index 319a24ff7f..8ca94cc0b9 100644 --- a/Gemfile +++ b/Gemfile @@ -4,11 +4,15 @@ source "https://rubygems.org" gemspec -rails_version = ENV.fetch("RAILS_VERSION", "7.2") -gem "rails", "~> #{rails_version}.0" +rails_version = ENV.fetch("RAILS_VERSION", "main") +if rails_version == "main" + gem "rails", github: "rails/rails", branch: "main" +else + gem "rails", "~> #{rails_version}.0" +end if ENV["DB"].nil? || ENV["DB"] == "sqlite" - gem "sqlite3", "~> 1.7.0" + gem "sqlite3", "~> 2.0.0" end if ENV["DB"] == "mysql" || ENV["DB"] == "mariadb" gem "mysql2", "~> 0.5.1" diff --git a/alchemy_cms.gemspec b/alchemy_cms.gemspec index a64c14fa08..ce360e9f53 100644 --- a/alchemy_cms.gemspec +++ b/alchemy_cms.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |gem| activesupport railties ].each do |rails_gem| - gem.add_runtime_dependency rails_gem, [">= 7.0", "< 7.3"] + gem.add_runtime_dependency rails_gem, [">= 7.0", "< 8.1"] end gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.14"] @@ -42,14 +42,14 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency "dragonfly_svg", ["~> 0.0.4"] gem.add_runtime_dependency "gutentag", ["~> 2.2", ">= 2.2.1"] gem.add_runtime_dependency "handlebars_assets", ["~> 0.23"] - gem.add_runtime_dependency "importmap-rails", ["~> 1.2", ">= 1.2.1"] + gem.add_runtime_dependency "importmap-rails", ["~> 2.0"] gem.add_runtime_dependency "jquery-rails", ["~> 4.0", ">= 4.0.4"] gem.add_runtime_dependency "kaminari", ["~> 1.1"] gem.add_runtime_dependency "originator", ["~> 3.1"] - gem.add_runtime_dependency "ransack", [">= 1.8", "< 5.0"] + gem.add_runtime_dependency "ransack", ["~> 4.2", "< 5.0"] gem.add_runtime_dependency "simple_form", [">= 4.0", "< 6"] gem.add_runtime_dependency "sprockets-rails", [">= 3.5", "< 4"] - gem.add_runtime_dependency "turbo-rails", [">= 1.4", "< 2.1"] + gem.add_runtime_dependency "turbo-rails", ["~> 2.0", "< 2.1"] gem.add_runtime_dependency "view_component", ["~> 3.0"] gem.add_development_dependency "capybara", ["~> 3.0"] @@ -59,7 +59,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency "puma", ["~> 6.0"] gem.add_development_dependency "rails-controller-testing", ["~> 1.0"] gem.add_development_dependency "rspec-activemodel-mocks", ["~> 1.0"] - gem.add_development_dependency "rspec-rails", ["~> 6.1"] + gem.add_development_dependency "rspec-rails", ["~> 7.0"] gem.add_development_dependency "simplecov", ["~> 0.20"] gem.add_development_dependency "selenium-webdriver", ["~> 4.10"] gem.add_development_dependency "webmock", ["~> 3.3"] diff --git a/lib/generators/alchemy/install/install_generator.rb b/lib/generators/alchemy/install/install_generator.rb index 22187ef29d..b09fbe8690 100644 --- a/lib/generators/alchemy/install/install_generator.rb +++ b/lib/generators/alchemy/install/install_generator.rb @@ -66,7 +66,11 @@ def copy_yml_files def install_assets copy_file "all.js", app_vendor_assets_path.join("javascripts", "alchemy", "admin", "all.js") copy_file "custom.css", app_assets_path.join("stylesheets/alchemy/admin/custom.css") - append_to_file Rails.root.join("app/assets/config/manifest.js"), "//= link alchemy/admin/custom.css\n" + if File.exist?(Rails.root.join("app/assets/config/manifest.js")) + append_to_file Rails.root.join("app/assets/config/manifest.js"), "//= link alchemy/admin/custom.css\n" + else + create_file Rails.root.join("app/assets/config/manifest.js"), "//= link alchemy/admin/custom.css\n" + end end def copy_demo_views diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 38ce4a431c..85a3c89717 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -23,7 +23,7 @@ module Dummy class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. if config.respond_to?(:load_defaults) - config.load_defaults ENV["RAILS_VERSION"] || 7.2 + config.load_defaults ENV["RAILS_VERSION"] == "main" ? 8.0 : ENV.fetch("RAILS_VERSION", 8.0) end # Settings in config/environments/* take precedence over those specified here. diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 676ff4a484..e76e531dbf 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_04_11_155901) do +ActiveRecord::Schema[8.0].define(version: 2024_04_11_155901) do create_table "alchemy_attachments", force: :cascade do |t| t.string "name" t.string "file_name"