Skip to content

Commit

Permalink
Rails 7.2 compatibility
Browse files Browse the repository at this point in the history
Add support for Rails 7.2 and drop support for Rails v6.0, since it
reached EOL on June 1st, 2023.

* rails 7.1.3.3 → 7.2.1
[announcement](https://rubyonrails.org/2024/8/22/Rails-7-2-1-has-been-released)
[changelog](https://github.com/rails/rails/releases/tag/v7.2.1)

* actioncable 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actioncable/CHANGELOG.md#rails-721-august-22-2024)

* actionmailbox 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actionmailbox/CHANGELOG.md#rails-721-august-22-2024)

* actionmailer 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actionmailer/CHANGELOG.md#rails-721-august-22-2024)

* actionpack 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actionpack/CHANGELOG.md#rails-721-august-22-2024)

* actiontext 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actiontext/CHANGELOG.md#rails-721-august-22-2024)

* actionview 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/actionview/CHANGELOG.md#rails-721-august-22-2024)

* activejob 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/activejob/CHANGELOG.md#rails-721-august-22-2024)

* activemodel 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/activemodel/CHANGELOG.md#rails-721-august-22-2024)

* activerecord 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/activerecord/CHANGELOG.md#rails-721-august-22-2024)

* activestorage 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/activestorage/CHANGELOG.md#rails-721-august-22-2024)

* activesupport 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/activesupport/CHANGELOG.md#rails-721-august-22-2024)

* builder 3.2.4 → 3.3.0
[changelog](https://github.com/rails/builder/blob/master/CHANGES)

* concurrent-ruby 1.2.3 → 1.3.4
[changelog](https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md)

* docile 1.4.0 → 1.4.1
[changelog](https://github.com/ms-ati/docile/blob/main/HISTORY.md#v141-may-12-2021)

* erubi 1.12.0 → 1.13.0
[changelog](https://github.com/jeremyevans/erubi/blob/master/CHANGELOG)

* irb 1.13.1 → 1.14.0
[changelog](https://github.com/ruby/irb/releases)

* mini_portile2 2.8.6 → 2.8.7

* minitest 5.23.0 → 5.25.1
[changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)

* net-imap 0.4.11 → 0.4.14
[changelog](https://github.com/ruby/net-imap/releases)

* nokogiri 1.16.5 → 1.16.7
[changelog](https://nokogiri.org/CHANGELOG.html)

* parallel 1.24.0 → 1.26.3

* parser 3.3.1.0 → 3.3.4.2
[changelog](https://github.com/whitequark/parser/blob/v3.3.4.2/CHANGELOG.md)

* racc 1.8.0 → 1.8.1
[changelog](https://github.com/ruby/racc/releases)

* rack 3.0.11 → 3.1.7
[changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)

* railties 7.1.3.3 → 7.2.1
[changelog](https://github.com/rails/rails/blob/v7.2.1/railties/CHANGELOG.md#rails-721-august-22-2024)

* rdoc 6.6.3.1 → 6.7.0
[changelog](https://github.com/ruby/rdoc/releases)

* reline 0.5.7 → 0.5.9
[changelog](https://github.com/ruby/reline/releases)

* rexml 3.2.8 → 3.3.6
[changelog](https://github.com/ruby/rexml/releases/tag/v3.3.6)

* rspec-expectations 3.13.0 → 3.13.2
[changelog](https://github.com/rspec/rspec-expectations/blob/v3.13.2/Changelog.md#3132--2024-08-20)

* rspec-rails 6.1.2 → 6.1.4
[changelog](https://github.com/rspec/rspec-rails/blob/v6.1.4/Changelog.md)

* rubocop 1.63.5 → 1.65.1
[changelog](https://github.com/rubocop/rubocop/releases/tag/v1.65.1)

* rubocop-ast 1.31.3 → 1.32.1
[changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)

* rubocop-performance 1.21.0 → 1.21.1
[changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md#1211-2024-06-16)

* rubocop-rails 2.25.0 → 2.25.1
[changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)

* rubocop-rspec 2.29.2 → 3.0.4
[changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)

* simple_form 5.3.0 → 5.3.1
[changelog](https://github.com/heartcombo/simple_form/blob/main/CHANGELOG.md#531)

* stringio 3.1.0 → 3.1.1

* zeitwerk 2.6.14 → 2.6.17
[changelog](https://github.com/fxn/zeitwerk/blob/master/CHANGELOG.md#2617-29-july-2024)
  • Loading branch information
mattmenefee committed Aug 23, 2024
1 parent bfa4880 commit ed6654f
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
gemfile: [dev/gemfiles/rails-6.1.x.gemfile, dev/gemfiles/rails-7.0.x.gemfile, Gemfile]
gemfile: [dev/gemfiles/rails-6.1.x.gemfile, dev/gemfiles/rails-7.0.x.gemfile, dev/gemfiles/rails-7.1.x.gemfile, Gemfile]
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
steps:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

* Add support for Rails v7.2 and drop support for Rails < 6.1 (#70)

## Version 2.2.1 (2024-05-20)

## Fixed
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
cocooned (2.2.1)
rails (>= 6.0, <= 7.2)
rails (>= 6.1, <= 8.0)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Cocooned makes it easier to handle nested forms in Rails.

Cocooned is form builder-agnostic: it works with standard Rails (>= 6.0, < 7.2) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).
Cocooned is form builder-agnostic: it works with standard Rails (>= 6.1, < 8.0) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).

1. [Background](#some-background)
2. [Installation](#installation)
Expand Down
2 changes: 1 addition & 1 deletion cocooned.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
end
spec.required_ruby_version = '>= 2.6'

spec.add_dependency 'rails', '>= 6.0', '<= 7.2'
spec.add_dependency 'rails', '>= 6.1', '<= 8.0'

spec.add_development_dependency 'bundler', '~> 2.1'
spec.add_development_dependency 'rake', '~> 13.0'
Expand Down
19 changes: 19 additions & 0 deletions dev/gemfiles/rails-7.1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

source 'http://rubygems.org'

gemspec path: '../..'

group :development, :test do
gem 'psych', '< 4.0.0'
gem 'puma'
gem 'rails', '~> 7.1.0'
gem 'shakapacker', '~> 7.1.0'
gem 'sqlite3', '~> 1.4'

gem 'formtastic', '~> 5.0'
gem 'nokogiri'
gem 'rspec-rails', '~> 6.0'
gem 'simplecov', require: false
gem 'simple_form', '~> 5.1'
end
3 changes: 0 additions & 3 deletions dev/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ AllCops:
Naming/FileName:
Exclude:
- 'dev/**/*.gemfile'

Rails/CompactBlank:
Enabled: false # As long as we support Rails 6.0
3 changes: 1 addition & 2 deletions lib/cocooned/helpers/containers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def cocooned_item(*args, &block)
protected

def cocooned_wrapper_defaults(options, additional_classes, mark)
# TODO: Replace with compact_blank when dropping support for Rails 6.0
classes = Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.reject(&:blank?)
classes = Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.compact_blank

{ class: (classes + additional_classes), data: { mark => true } }
end
Expand Down
3 changes: 1 addition & 2 deletions lib/cocooned/tags/add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ module AssociationOptions # :nodoc:
protected

def association_options
# TODO: Replace with compact_blank when dropping support for Rails 6.0
{
association: association,
template: html_template_name,
association_insertion_count: [options.delete(:count).to_i, 1].compact.max,
association_insertion_node: options.delete(:insertion_node),
association_insertion_method: options.delete(:insertion_method),
association_insertion_traversal: options.delete(:insertion_traversal)
}.reject { |_, value| value.blank? }
}.compact_blank
end
end

Expand Down
6 changes: 2 additions & 4 deletions lib/cocooned/tags/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ def html_options
@html_options ||= begin
options[:class] = html_classes
options[:data] = html_data
# TODO: Replace with compact_blank when dropping support for Rails 6.0
options.reject { |_, value| value.blank? }
options.compact_blank
end
end

def html_classes
# TODO: Replace with compact_blank when dropping support for Rails 6.0
Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.reject(&:blank?)
Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.compact_blank
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a companion package for the [cocooned Ruby gem](https://rubygems.org/gem

Cocooned makes it easier to handle nested forms in Rails.

Cocooned is form builder-agnostic: it works with standard Rails (>= 6.0, < 7.2) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).
Cocooned is form builder-agnostic: it works with standard Rails (>= 6.1, < 8.0) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).

1. [Installation](#installation)
2. [Import](#import), default, custom or with [jQuery integration](#jquery-integration)
Expand Down

0 comments on commit ed6654f

Please sign in to comment.