Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused &block argument #1776

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/nokogiri/xml/document.rb
Expand Up @@ -41,7 +41,7 @@ class Document < Nokogiri::XML::Node
#
# Nokogiri.XML() is a convenience method which will call this method.
#
def self.parse string_or_io, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block
def self.parse string_or_io, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML
options = Nokogiri::XML::ParseOptions.new(options) if Integer === options
# Give the options to the user
yield options if block_given?
Expand Down
2 changes: 1 addition & 1 deletion lib/nokogiri/xml/node.rb
Expand Up @@ -795,7 +795,7 @@ def <=> other
# Do xinclude substitution on the subtree below node. If given a block, a
# Nokogiri::XML::ParseOptions object initialized from +options+, will be
# passed to it, allowing more convenient modification of the parser options.
def do_xinclude options = XML::ParseOptions::DEFAULT_XML, &block
def do_xinclude options = XML::ParseOptions::DEFAULT_XML
options = Nokogiri::XML::ParseOptions.new(options) if Integer === options

# give options to user
Expand Down
8 changes: 4 additions & 4 deletions lib/nokogiri/xml/node_set.rb
Expand Up @@ -44,7 +44,7 @@ def empty?

###
# Returns the index of the first node in self that is == to +node+ or meets the given block. Returns nil if no match is found.
def index(node = nil, &block)
def index(node = nil)
if node
warn "given block not used" if block_given?
each_with_index { |member, j| return j if member == node }
Expand Down Expand Up @@ -197,7 +197,7 @@ def remove_attr name

###
# Iterate over each node, yielding to +block+
def each(&block)
def each
return to_enum unless block_given?

0.upto(length - 1) do |x|
Expand Down Expand Up @@ -230,8 +230,8 @@ def inner_html *args
end

###
# Wrap this NodeSet with +html+ or the results of the builder in +blk+
def wrap(html, &blk)
# Wrap this NodeSet with +html+
def wrap(html)
each do |j|
new_parent = document.parse(html).first
j.add_next_sibling(new_parent)
Expand Down