lib/heartml/fragment.rb in heartml-1.0.0.beta7 vs lib/heartml/fragment.rb in heartml-1.0.0.beta8
- old
+ new
@@ -11,13 +11,13 @@
end
# NOTE: for some reason, the traverse method yields node children first, then the
# parent node. That doesn't work for our case. We want to go strictly in source order.
# So this is our own implementation of that.
- def traverse(node, &block)
+ def traverse(node, &block) # rubocop:disable Style/ArgumentsForwarding
yield(node)
- node.children.each { |child| traverse(child, &block) }
+ node.children.each { |child| traverse(child, &block) } # rubocop:disable Style/ArgumentsForwarding
end
def process(fragment = @fragment) # rubocop:disable Metrics
traverse(fragment) do |node| # rubocop:disable Metrics/BlockLength
process_attribute_bindings(node)
@@ -77,10 +77,10 @@
@attribute_bindings.each do |attribute_binding|
next if attribute_binding.only_for_tag && node.name != attribute_binding.only_for_tag.to_s
next unless attribute_binding.matcher.match?(name)
next if attribute_binding.method.receiver._check_stack(node)
- break unless attribute_binding.method.(attribute: attr_node, node: node)
+ break unless attribute_binding.method.(attribute: attr_node, node:)
end
rescue Exception => e # rubocop:disable Lint/RescueException
line_segments = [@component.class.heart_module, @component._line_number_of_node(attr_node)]
raise e.class, e.message.lines.first, [line_segments.join(":"), *e.backtrace]
end