From 21c61af450753357b1c0f71e8bed7c47405c6a65 Mon Sep 17 00:00:00 2001 From: Jared White Date: Sun, 12 May 2024 20:52:09 -0700 Subject: [PATCH] Backtrack on odd symbol syntax --- bridgetown-core/lib/bridgetown-core/component.rb | 2 +- bridgetown-core/lib/bridgetown-core/helpers.rb | 2 +- bridgetown-core/lib/bridgetown-core/ruby_template_view.rb | 2 +- bridgetown-core/lib/bridgetown-core/slot.rb | 2 +- .../lib/bridgetown/foundation/refine_ext/symbol.rb | 4 ---- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/component.rb b/bridgetown-core/lib/bridgetown-core/component.rb index ce8ae0ed5..a7ef15365 100644 --- a/bridgetown-core/lib/bridgetown-core/component.rb +++ b/bridgetown-core/lib/bridgetown-core/component.rb @@ -121,7 +121,7 @@ def slot(name, input = nil, replace: false, &block) content = block.nil? ? input.to_s : view_context.capture(&block) name = name.to_s - slots.reject!(&:name.(:==, name)) if replace + slots.reject! { _1.name == name } if replace slots << Slot.new(name:, content:, context: self, transform: false) diff --git a/bridgetown-core/lib/bridgetown-core/helpers.rb b/bridgetown-core/lib/bridgetown-core/helpers.rb index 34256e2ca..0ad0ac942 100644 --- a/bridgetown-core/lib/bridgetown-core/helpers.rb +++ b/bridgetown-core/lib/bridgetown-core/helpers.rb @@ -209,7 +209,7 @@ def slot(name, input = nil, replace: false, transform: true, &block) end name = name.to_s - resource.slots.reject!(&:name.(:==, name)) if replace + resource.slots.reject! { _1.name == name } if replace resource.slots << Slot.new( name:, content:, diff --git a/bridgetown-core/lib/bridgetown-core/ruby_template_view.rb b/bridgetown-core/lib/bridgetown-core/ruby_template_view.rb index 36d453914..747b1a1a5 100644 --- a/bridgetown-core/lib/bridgetown-core/ruby_template_view.rb +++ b/bridgetown-core/lib/bridgetown-core/ruby_template_view.rb @@ -129,7 +129,7 @@ def _liquid_context end def _partial_path(partial_name, ext) - partial_name = partial_name.split("/").tap(&:last.(:prepend, "_")).join("/") + partial_name = partial_name.split("/").tap { _1.last.prepend("_") }.join("/") # TODO: see if there's a workaround for this to speed up performance site.in_source_dir(site.config[:partials_dir], "#{partial_name}.#{ext}") diff --git a/bridgetown-core/lib/bridgetown-core/slot.rb b/bridgetown-core/lib/bridgetown-core/slot.rb index 5d12585a5..87a79cd8f 100644 --- a/bridgetown-core/lib/bridgetown-core/slot.rb +++ b/bridgetown-core/lib/bridgetown-core/slot.rb @@ -35,7 +35,7 @@ def converters context.transformer.send(:converters) : context.send(:converters) - document_converters.select(&:class.(:supports_slots?)) + document_converters.select { _1.class.supports_slots? } end end end diff --git a/bridgetown-foundation/lib/bridgetown/foundation/refine_ext/symbol.rb b/bridgetown-foundation/lib/bridgetown/foundation/refine_ext/symbol.rb index e2a65fc0d..903042404 100644 --- a/bridgetown-foundation/lib/bridgetown/foundation/refine_ext/symbol.rb +++ b/bridgetown-foundation/lib/bridgetown/foundation/refine_ext/symbol.rb @@ -7,10 +7,6 @@ module Symbol def with(...) ->(caller, *rest) { caller.public_send(self, *rest, ...) } end - - def call(...) - ->(caller, *rest) { caller.public_send(self, *rest).public_send(...) } - end end end end