lib/hot_module/fragment.rb in hot_module-1.0.0.alpha1 vs lib/hot_module/fragment.rb in hot_module-1.0.0.alpha2

- old
+ new

@@ -20,18 +20,20 @@ traverse(fragment) do |node| process_attribute_bindings(node) end end - def process_attribute_bindings(node) + def process_attribute_bindings(node) # rubocop:todo Metrics node.attributes.each do |name, attr_node| @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) end rescue Exception => e # rubocop:disable Lint/RescueException - raise e.class, e.message.lines.first, ["#{@html_module}:#{attr_node.line}", *e.backtrace] + raise e.class, e.message.lines.first, ["#{@html_module}:#{attr_node}", *e.backtrace] end end end end