cocooned 2.2.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a59c32459a7aee2edc8eb770c60764f1de44003cceed283335b969c81541aa2
4
- data.tar.gz: 1be857f2d25e18a1cc91087d5f8cc2c68ce1b3b3abdb468b6dd52751724aa5af
3
+ metadata.gz: b4f258af059810a6c416beec05676cb361a23922b25706daa7f9b2c8b9f0eacf
4
+ data.tar.gz: 21c5883b7dfd83c6b1f58b513f81af3bb04cf0704479611d20c29b6d19b4e1b0
5
5
  SHA512:
6
- metadata.gz: 16645d6101fa1b8010e20ea13282d098a31e129bc23e8ee14fd6510278a6f4dc40421e68e486921143e2305fc183de38315479fda24a40779394fa1797477676
7
- data.tar.gz: a4cc58468cde6ec46dd12defb9bbc0845aba6d846058425082c28a3ac81dfc9171e4c0fd9df7e9f942c1915cbc548287aa34fcf5eaaeec1d5859eb0e293c03f0
6
+ metadata.gz: 1e2613dbe355017c12b3f370c79721246c798661fb8a7ad6e73a243af0cc1fbe0ee12c605dbc78aa50a82e1ca4a83c7df5c5c1cdb3e42d97ac2486c4765bcadb
7
+ data.tar.gz: 1e2cd045d9f3aa4f9862309626831aa70d4d2c71e495783dbc332a5cb306af567eb9590ea093f9ea5a3fbca63657c87132f4fb5be4f14653292a7482a3b5d023
data/CHANGELOG.md CHANGED
@@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## Version 2.4.0 (2024-10-01)
10
+
11
+ ### Fixed
12
+
13
+ * Drop support for Rails < 7.0 (#73, thanks @mattmenefee)
14
+
15
+ ### Changed
16
+
17
+ * Reintroduce Ruby 2.7 to the test matrix (#80)
18
+ So tested rubies are the same as supported Rails versions minimum requirements.
19
+
20
+ ## Version 2.3.0 (2024-08-23)
21
+
22
+ ### Fixed
23
+
24
+ * Add support for Rails v7.2 and drop support for Rails < 6.1 (#70, thanks @mattmenefee)
25
+
9
26
  ## Version 2.2.1 (2024-05-20)
10
27
 
11
28
  ## Fixed
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Cocooned makes it easier to handle nested forms in Rails.
7
7
 
8
- Cocooned is form builder-agnostic: it works with standard Rails (>= 6.0, < 7.1) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).
8
+ Cocooned is form builder-agnostic: it works with standard Rails (>= 7.0, < 8.0) form helpers, [Formtastic](https://github.com/justinfrench/formtastic) or [SimpleForm](https://github.com/plataformatec/simple_form).
9
9
 
10
10
  1. [Background](#some-background)
11
11
  2. [Installation](#installation)
data/cocooned.gemspec CHANGED
@@ -38,9 +38,9 @@ Gem::Specification.new do |spec|
38
38
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
39
39
  f.match(excluded_dirs) || excluded_files.include?(f)
40
40
  end
41
- spec.required_ruby_version = '>= 2.6'
41
+ spec.required_ruby_version = '>= 2.7'
42
42
 
43
- spec.add_dependency 'rails', '>= 6.0', '<= 7.2'
43
+ spec.add_dependency 'rails', '>= 7.0', '<= 8.0'
44
44
 
45
45
  spec.add_development_dependency 'bundler', '~> 2.1'
46
46
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -13,7 +13,7 @@ module Cocooned
13
13
 
14
14
  def initialize(deprecation_horizon = nil, gem_name = 'Cocooned')
15
15
  deprecation_horizon ||= format('%<major>d.0', major: Gem::Version.new(Cocooned::VERSION).segments.first + 1)
16
- super(deprecation_horizon, gem_name)
16
+ super
17
17
  end
18
18
  end
19
19
 
@@ -22,15 +22,15 @@ module Cocooned
22
22
  module Helpers # :nodoc:
23
23
  module Tags # :nodoc:
24
24
  # @deprecated: Please use {#cocooned_add_item_link} instead
25
- def link_to_add_association(*args, &block)
26
- cocooned_add_item_link(*args, &block)
25
+ def link_to_add_association(...)
26
+ cocooned_add_item_link(...)
27
27
  end
28
28
  deprecate link_to_add_association: 'Use :cocooned_add_link instead',
29
29
  deprecator: Deprecation['3.0']
30
30
 
31
31
  # @deprecated: Please use {#cocooned_remove_item_link} instead
32
- def link_to_remove_association(*args, &block)
33
- cocooned_remove_item_link(*args, &block)
32
+ def link_to_remove_association(...)
33
+ cocooned_remove_item_link(...)
34
34
  end
35
35
  deprecate link_to_remove_association: 'Use :cocooned_remove_item_link instead',
36
36
  deprecator: Deprecation['3.0']
@@ -64,8 +64,7 @@ module Cocooned
64
64
  protected
65
65
 
66
66
  def cocooned_wrapper_defaults(options, additional_classes, mark)
67
- # TODO: Replace with compact_blank when dropping support for Rails 6.0
68
- classes = Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.reject(&:blank?)
67
+ classes = Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.compact_blank
69
68
 
70
69
  { class: (classes + additional_classes), data: { mark => true } }
71
70
  end
@@ -7,7 +7,6 @@ module Cocooned
7
7
  protected
8
8
 
9
9
  def association_options
10
- # TODO: Replace with compact_blank when dropping support for Rails 6.0
11
10
  {
12
11
  association: association,
13
12
  template: html_template_name,
@@ -15,7 +14,7 @@ module Cocooned
15
14
  association_insertion_node: options.delete(:insertion_node),
16
15
  association_insertion_method: options.delete(:insertion_method),
17
16
  association_insertion_traversal: options.delete(:insertion_traversal)
18
- }.reject { |_, value| value.blank? }
17
+ }.compact_blank
19
18
  end
20
19
  end
21
20
 
@@ -32,7 +31,7 @@ module Cocooned
32
31
  end
33
32
 
34
33
  def render(as: :link)
35
- template.safe_join([super(as: as), html_template])
34
+ template.safe_join([super, html_template])
36
35
  end
37
36
 
38
37
  protected
@@ -47,14 +47,12 @@ module Cocooned
47
47
  @html_options ||= begin
48
48
  options[:class] = html_classes
49
49
  options[:data] = html_data
50
- # TODO: Replace with compact_blank when dropping support for Rails 6.0
51
- options.reject { |_, value| value.blank? }
50
+ options.compact_blank
52
51
  end
53
52
  end
54
53
 
55
54
  def html_classes
56
- # TODO: Replace with compact_blank when dropping support for Rails 6.0
57
- Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.reject(&:blank?)
55
+ Array.wrap(options.delete(:class)).flat_map { |k| k.to_s.split }.compact_blank
58
56
  end
59
57
  end
60
58
  end
@@ -6,7 +6,7 @@ module Cocooned
6
6
  include Cocooned::TagsHelper::AssociationLabel
7
7
 
8
8
  def render(as: :link)
9
- template.safe_join([hidden_field, super(as: as)])
9
+ template.safe_join([hidden_field, super])
10
10
  end
11
11
 
12
12
  protected
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocooned
4
- VERSION = '2.2.1'
4
+ VERSION = '2.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocooned
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-20 00:00:00.000000000 Z
12
+ date: 2024-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,20 +17,20 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '6.0'
20
+ version: '7.0'
21
21
  - - "<="
22
22
  - !ruby/object:Gem::Version
23
- version: '7.2'
23
+ version: '8.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '6.0'
30
+ version: '7.0'
31
31
  - - "<="
32
32
  - !ruby/object:Gem::Version
33
- version: '7.2'
33
+ version: '8.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: '2.6'
134
+ version: '2.7'
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="