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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/cocooned.gemspec +1 -1
- data/lib/cocooned/deprecation.rb +1 -1
- data/lib/cocooned/helpers/containers.rb +1 -2
- data/lib/cocooned/tags/add.rb +2 -3
- data/lib/cocooned/tags/base.rb +2 -4
- data/lib/cocooned/tags/remove.rb +1 -1
- data/lib/cocooned/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09dea153d60f4775a1971687cd1559ee09ef878f97ce865088ab76189db919e7'
|
4
|
+
data.tar.gz: dea0da54a7111ac9723faec4ea74f3f058e3db2884aecd14233b0e13c74881e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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'
|
data/lib/cocooned/deprecation.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
data/lib/cocooned/tags/add.rb
CHANGED
@@ -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
|
-
}.
|
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
|
34
|
+
template.safe_join([super, html_template])
|
36
35
|
end
|
37
36
|
|
38
37
|
protected
|
data/lib/cocooned/tags/base.rb
CHANGED
@@ -47,14 +47,12 @@ module Cocooned
|
|
47
47
|
@html_options ||= begin
|
48
48
|
options[:class] = html_classes
|
49
49
|
options[:data] = html_data
|
50
|
-
|
51
|
-
options.reject { |_, value| value.blank? }
|
50
|
+
options.compact_blank
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
54
|
def html_classes
|
56
|
-
|
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
|
data/lib/cocooned/tags/remove.rb
CHANGED
data/lib/cocooned/version.rb
CHANGED
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.
|
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-
|
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.
|
20
|
+
version: '6.1'
|
21
21
|
- - "<="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
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.
|
30
|
+
version: '6.1'
|
31
31
|
- - "<="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8.0'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bundler
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|