diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 24e56a2c70..ba2b2e5f1f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: - name: Install Ruby and gems uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" bundler-cache: true rubygems: "latest" - name: Lint Ruby files diff --git a/.rubocop.yml b/.rubocop.yml index 6faf5db92c..2db274059e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ require: standard AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 inherit_gem: standard: config/base.yml diff --git a/.standard.yml b/.standard.yml index 4952d35804..6ab391377b 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,4 +1,4 @@ parallel: true -ruby_version: 3.0 +ruby_version: 3.1 ignore: - "spec/dummy/**/*" diff --git a/alchemy_cms.gemspec b/alchemy_cms.gemspec index f516abd7cc..4005df17af 100644 --- a/alchemy_cms.gemspec +++ b/alchemy_cms.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |gem| gem.summary = "A powerful, userfriendly and flexible CMS for Rails" gem.description = "Alchemy is a powerful, userfriendly and flexible Rails CMS." gem.requirements << "ImageMagick (libmagick), v6.6 or greater." - gem.required_ruby_version = ">= 3.0.0" + gem.required_ruby_version = ">= 3.1.0" gem.license = "BSD-3-Clause" gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/|bun\.lockdb|package\.json|^\.}) } gem.require_paths = ["lib"] diff --git a/app/helpers/alchemy/base_helper.rb b/app/helpers/alchemy/base_helper.rb index f2abf1123d..59d9181a81 100644 --- a/app/helpers/alchemy/base_helper.rb +++ b/app/helpers/alchemy/base_helper.rb @@ -42,8 +42,8 @@ def render_icon(icon_name, options = {}) #
Caution! This is a warning!
# <% end %> # - def render_message(type = :info, msg = nil, &blk) - render Alchemy::Admin::Message.new(msg || capture(&blk), type: type) + def render_message(type = :info, msg = nil, &) + render Alchemy::Admin::Message.new(msg || capture(&), type: type) end # Checks if the given argument is a String or a Page object. diff --git a/app/helpers/alchemy/pages_helper.rb b/app/helpers/alchemy/pages_helper.rb index 733a637e85..5978de4987 100644 --- a/app/helpers/alchemy/pages_helper.rb +++ b/app/helpers/alchemy/pages_helper.rb @@ -62,8 +62,8 @@ def render_page_layout # # renders +app/views/alchemy/site_layouts/_default_site.html.erb+ for the site named "Default Site". # - def render_site_layout(&block) - render current_alchemy_site, &block + def render_site_layout(&) + render(current_alchemy_site, &) rescue ActionView::MissingTemplate => error error_or_warning(error, "Site layout for #{current_alchemy_site.try(:name)} not found. Please run `rails g alchemy:site_layouts`") end diff --git a/app/models/alchemy/elements_repository.rb b/app/models/alchemy/elements_repository.rb index 96c0cabd8f..85be26d3fa 100644 --- a/app/models/alchemy/elements_repository.rb +++ b/app/models/alchemy/elements_repository.rb @@ -115,8 +115,8 @@ def children_of(parent) self.class.new(select { |e| e.parent_element_id == parent.id }) end - def each(&blk) - elements.each(&blk) + def each(&) + elements.each(&) end private diff --git a/lib/alchemy/test_support/capybara_helpers.rb b/lib/alchemy/test_support/capybara_helpers.rb index b2396b914e..4daad38164 100644 --- a/lib/alchemy/test_support/capybara_helpers.rb +++ b/lib/alchemy/test_support/capybara_helpers.rb @@ -63,8 +63,8 @@ def click_icon(name) private - def within_entire_page(&block) - within(:xpath, "//body", &block) + def within_entire_page(&) + within(:xpath, "//body", &) end def find_label_by_text(text)