Skip to content

Commit

Permalink
Backtrack on odd symbol syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed May 13, 2024
1 parent bc840d4 commit 21c61af
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:,
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/ruby_template_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/slot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 21c61af

Please sign in to comment.