Skip to content

Commit

Permalink
Prepare 2.4 release (#83)
Browse files Browse the repository at this point in the history
* Apply RuboCop recommendations
* Rebuild integration tests fixtures
* Bump version to 2.4.0
  • Loading branch information
gael-ian authored Oct 1, 2024
1 parent 5b9d291 commit 3df6356
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## Version 2.4.0 (2024-10-01)

### Fixed

* Drop support for Rails < 7.0 (TODO: add PR number)
* Drop support for Rails < 7.0 (#73, thanks @mattmenefee)

### Changed

* Reintroduce Ruby 2.7 to the test matrix (#80)
So tested rubies are the same as supported Rails versions minimum requirements.

## Version 2.3.0 (2024-08-23)

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
cocooned (2.3.0)
cocooned (2.4.0)
rails (>= 7.0, <= 8.0)

GEM
Expand Down
8 changes: 4 additions & 4 deletions lib/cocooned/deprecation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ module Deprecated # :nodoc:
module Helpers # :nodoc:
module Tags # :nodoc:
# @deprecated: Please use {#cocooned_add_item_link} instead
def link_to_add_association(*args, &block)
cocooned_add_item_link(*args, &block)
def link_to_add_association(...)
cocooned_add_item_link(...)
end
deprecate link_to_add_association: 'Use :cocooned_add_link instead',
deprecator: Deprecation['3.0']

# @deprecated: Please use {#cocooned_remove_item_link} instead
def link_to_remove_association(*args, &block)
cocooned_remove_item_link(*args, &block)
def link_to_remove_association(...)
cocooned_remove_item_link(...)
end
deprecate link_to_remove_association: 'Use :cocooned_remove_item_link instead',
deprecator: Deprecation['3.0']
Expand Down
2 changes: 1 addition & 1 deletion lib/cocooned/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Cocooned
VERSION = '2.3.0'
VERSION = '2.4.0'
end
2 changes: 1 addition & 1 deletion npm/__tests__/fixtures/rails.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"link":"<form action=\"/lists\" accept-charset=\"UTF-8\" method=\"post\">\n\n <div class=\"field\">\n <label for=\"list_name\">Name</label>\n <input type=\"text\" name=\"list[name]\" id=\"list_name\">\n </div>\n\n <h3>Items</h3>\n <div class=\"cocooned-container\" data-cocooned-container=\"true\" data-cocooned-options='{\"limit\":5,\"reorderable\":true}'>\n \n <div>\n <a partial=\"lists/form/item\" class=\"cocooned-add add_fields\" data-association=\"items\" data-template=\"bb746698-020e-4cdf-9680-44925be8a8bf\" data-association-insertion-count=\"1\" data-cocooned-trigger=\"add\" href=\"#\">Add item</a><template data-name=\"bb746698-020e-4cdf-9680-44925be8a8bf\"><div class=\"cocooned-item nested-fields\" data-cocooned-item=\"true\">\n <input value=\"false\" autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][_destroy]\" id=\"list_items_attributes_new_items__destroy\"><a class=\"cocooned-remove remove_fields\" data-cocooned-trigger=\"remove\" data-cocooned-persisted=\"false\" href=\"#\">Remove</a>\n <a class=\"cocooned-move-up\" data-cocooned-trigger=\"up\" href=\"#\">Move up</a>\n <a class=\"cocooned-move-down\" data-cocooned-trigger=\"down\" href=\"#\">Move down</a>\n\n <label for=\"list_items_attributes_new_items_label\">Label</label>\n <input type=\"text\" name=\"list[items_attributes][new_items][label]\" id=\"list_items_attributes_new_items_label\">\n <input autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][position]\" id=\"list_items_attributes_new_items_position\">\n</div></template>\n </div>\n</div>\n <div class=\"actions\">\n <input type=\"submit\" name=\"commit\" value=\"Create List\" data-disable-with=\"Create List\">\n </div>\n</form>","button":"<form action=\"/lists\" accept-charset=\"UTF-8\" method=\"post\">\n\n <div class=\"field\">\n <label for=\"list_name\">Name</label>\n <input type=\"text\" name=\"list[name]\" id=\"list_name\">\n </div>\n\n <h3>Items</h3>\n <div class=\"cocooned-container\" data-cocooned-container=\"true\" data-cocooned-options='{\"limit\":5,\"reorderable\":true}'>\n \n <div>\n <button name=\"button\" type=\"button\" partial=\"lists/form/item\" class=\"cocooned-add add_fields\" data-association=\"items\" data-template=\"ebb580f1-5e3c-46f4-9bbb-8354a70e26bb\" data-association-insertion-count=\"1\" data-cocooned-trigger=\"add\">Add item</button><template data-name=\"ebb580f1-5e3c-46f4-9bbb-8354a70e26bb\"><div class=\"cocooned-item nested-fields\" data-cocooned-item=\"true\">\n <input value=\"false\" autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][_destroy]\" id=\"list_items_attributes_new_items__destroy\"><button name=\"button\" type=\"button\" class=\"cocooned-remove remove_fields\" data-cocooned-trigger=\"remove\" data-cocooned-persisted=\"false\">Remove</button>\n <button name=\"button\" type=\"button\" class=\"cocooned-move-up\" data-cocooned-trigger=\"up\">Move up</button>\n <button name=\"button\" type=\"button\" class=\"cocooned-move-down\" data-cocooned-trigger=\"down\">Move down</button>\n\n <label for=\"list_items_attributes_new_items_label\">Label</label>\n <input type=\"text\" name=\"list[items_attributes][new_items][label]\" id=\"list_items_attributes_new_items_label\">\n <input autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][position]\" id=\"list_items_attributes_new_items_position\">\n</div></template>\n </div>\n</div>\n <div class=\"actions\">\n <input type=\"submit\" name=\"commit\" value=\"Create List\" data-disable-with=\"Create List\">\n </div>\n</form>"}
{"link":"<form action=\"/lists\" accept-charset=\"UTF-8\" method=\"post\">\n\n <div class=\"field\">\n <label for=\"list_name\">Name</label>\n <input type=\"text\" name=\"list[name]\" id=\"list_name\">\n </div>\n\n <h3>Items</h3>\n <div class=\"cocooned-container\" data-cocooned-container=\"true\" data-cocooned-options='{\"limit\":5,\"reorderable\":true}'>\n \n <div>\n <a partial=\"lists/form/item\" class=\"cocooned-add add_fields\" data-association=\"items\" data-template=\"956ed3f9-79d6-4412-8697-538d7dab8223\" data-association-insertion-count=\"1\" data-cocooned-trigger=\"add\" href=\"#\">Add item</a><template data-name=\"956ed3f9-79d6-4412-8697-538d7dab8223\"><div class=\"cocooned-item nested-fields\" data-cocooned-item=\"true\">\n <input value=\"false\" autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][_destroy]\" id=\"list_items_attributes_new_items__destroy\"><a class=\"cocooned-remove remove_fields\" data-cocooned-trigger=\"remove\" data-cocooned-persisted=\"false\" href=\"#\">Remove</a>\n <a class=\"cocooned-move-up\" data-cocooned-trigger=\"up\" href=\"#\">Move up</a>\n <a class=\"cocooned-move-down\" data-cocooned-trigger=\"down\" href=\"#\">Move down</a>\n\n <label for=\"list_items_attributes_new_items_label\">Label</label>\n <input type=\"text\" name=\"list[items_attributes][new_items][label]\" id=\"list_items_attributes_new_items_label\">\n <input autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][position]\" id=\"list_items_attributes_new_items_position\">\n</div></template>\n </div>\n</div>\n <div class=\"actions\">\n <input type=\"submit\" name=\"commit\" value=\"Create List\" data-disable-with=\"Create List\">\n </div>\n</form>","button":"<form action=\"/lists\" accept-charset=\"UTF-8\" method=\"post\">\n\n <div class=\"field\">\n <label for=\"list_name\">Name</label>\n <input type=\"text\" name=\"list[name]\" id=\"list_name\">\n </div>\n\n <h3>Items</h3>\n <div class=\"cocooned-container\" data-cocooned-container=\"true\" data-cocooned-options='{\"limit\":5,\"reorderable\":true}'>\n \n <div>\n <button name=\"button\" type=\"button\" partial=\"lists/form/item\" class=\"cocooned-add add_fields\" data-association=\"items\" data-template=\"23877226-6900-4e37-968a-5f9f182bae36\" data-association-insertion-count=\"1\" data-cocooned-trigger=\"add\">Add item</button><template data-name=\"23877226-6900-4e37-968a-5f9f182bae36\"><div class=\"cocooned-item nested-fields\" data-cocooned-item=\"true\">\n <input value=\"false\" autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][_destroy]\" id=\"list_items_attributes_new_items__destroy\"><button name=\"button\" type=\"button\" class=\"cocooned-remove remove_fields\" data-cocooned-trigger=\"remove\" data-cocooned-persisted=\"false\">Remove</button>\n <button name=\"button\" type=\"button\" class=\"cocooned-move-up\" data-cocooned-trigger=\"up\">Move up</button>\n <button name=\"button\" type=\"button\" class=\"cocooned-move-down\" data-cocooned-trigger=\"down\">Move down</button>\n\n <label for=\"list_items_attributes_new_items_label\">Label</label>\n <input type=\"text\" name=\"list[items_attributes][new_items][label]\" id=\"list_items_attributes_new_items_label\">\n <input autocomplete=\"off\" type=\"hidden\" name=\"list[items_attributes][new_items][position]\" id=\"list_items_attributes_new_items_position\">\n</div></template>\n </div>\n</div>\n <div class=\"actions\">\n <input type=\"submit\" name=\"commit\" value=\"Create List\" data-disable-with=\"Create List\">\n </div>\n</form>"}
8 changes: 4 additions & 4 deletions spec/support/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def html(*args, **options, &block)
Nokogiri::HTML5.fragment(tag.render(as: :link))
end

def tag(*args, **options, &block)
html(*args, **options, &block).at('a')
def tag(...)
html(...).at('a')
end
end

Expand All @@ -18,8 +18,8 @@ def html(*args, **options, &block)
Nokogiri::HTML5.fragment(tag.render(as: :button))
end

def tag(*args, **options, &block)
html(*args, **options, &block).at('button')
def tag(...)
html(...).at('button')
end
end
end
Expand Down

0 comments on commit 3df6356

Please sign in to comment.