From 2ab96f7c61e915a2f203ba457c0c91a3875967f0 Mon Sep 17 00:00:00 2001 From: Brian Lesperance Date: Thu, 14 Nov 2024 20:33:11 -0600 Subject: [PATCH] Nokogiri::XML::SAX::PushParser.new() supports keyword arguments Related to https://github.com/sparklemotion/nokogiri/issues/3323 --- lib/nokogiri/xml/sax/push_parser.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nokogiri/xml/sax/push_parser.rb b/lib/nokogiri/xml/sax/push_parser.rb index 5295b0cf3e..70bb3850b2 100644 --- a/lib/nokogiri/xml/sax/push_parser.rb +++ b/lib/nokogiri/xml/sax/push_parser.rb @@ -32,7 +32,11 @@ class PushParser ### # Create a new PushParser with +doc+ as the SAX Document, providing # an optional +file_name+ and +encoding+ - def initialize(doc = XML::SAX::Document.new, file_name = nil, encoding = "UTF-8") + def initialize( + doc = XML::SAX::Document.new, + file_name_ = nil, encoding_ = "UTF-8", + file_name: file_name_, encoding: encoding_ + ) @document = doc @encoding = encoding @sax_parser = XML::SAX::Parser.new(doc)