cocooned 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a59c32459a7aee2edc8eb770c60764f1de44003cceed283335b969c81541aa2
4
- data.tar.gz: 1be857f2d25e18a1cc91087d5f8cc2c68ce1b3b3abdb468b6dd52751724aa5af
3
+ metadata.gz: '09dea153d60f4775a1971687cd1559ee09ef878f97ce865088ab76189db919e7'
4
+ data.tar.gz: dea0da54a7111ac9723faec4ea74f3f058e3db2884aecd14233b0e13c74881e5
5
5
  SHA512:
6
- metadata.gz: 16645d6101fa1b8010e20ea13282d098a31e129bc23e8ee14fd6510278a6f4dc40421e68e486921143e2305fc183de38315479fda24a40779394fa1797477676
7
- data.tar.gz: a4cc58468cde6ec46dd12defb9bbc0845aba6d846058425082c28a3ac81dfc9171e4c0fd9df7e9f942c1915cbc548287aa34fcf5eaaeec1d5859eb0e293c03f0
6
+ metadata.gz: aa27825fcb619f22b8bf86472a367c2ad131b8b84fffbabc2a80a7b90d50aa42a0a5dbaf8c873c751e7f043a527a044d4bce84706f3c1808297c26bcf3d658f5
7
+ data.tar.gz: b1338f4ff4433fd28cd967475d49dddc638df8b2e579d75675316ac8cacf8e3a318e4651c118060f576e25b46a11214b8b97b6109c2db8758036050311c153fc
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ 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.3.0 (2024-08-23)
10
+
11
+ ### Fixed
12
+
13
+ * Add support for Rails v7.2 and drop support for Rails < 6.1 (#70, thanks @mattmenefee)
14
+
9
15
  ## Version 2.2.1 (2024-05-20)
10
16
 
11
17
  ## 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 (>= 6.1, < 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
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  end
41
41
  spec.required_ruby_version = '>= 2.6'
42
42
 
43
- spec.add_dependency 'rails', '>= 6.0', '<= 7.2'
43
+ spec.add_dependency 'rails', '>= 6.1', '<= 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
 
@@ -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.3.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.3.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-08-23 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: '6.1'
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: '6.1'
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