-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix Converters::CSV.each_host_rows
yielded value
#13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor additional changes needed.
lib/ronin/nmap/converters/csv.rb
Outdated
@@ -102,7 +102,7 @@ def self.each_host_rows(host) | |||
] | |||
|
|||
host.each_port do |port| | |||
yield(*host_row, *port_to_row(port)) | |||
yield([*host_row, *port_to_row(port)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably simplify this to just host_row + port_to_row(port)
.
lib/ronin/nmap/converters/csv.rb
Outdated
@@ -102,7 +102,7 @@ def self.each_host_rows(host) | |||
] | |||
|
|||
host.each_port do |port| | |||
yield(*host_row, *port_to_row(port)) | |||
yield([*host_row, *port_to_row(port)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're yielding an Array instead of multiple arguments, we should also change the above code on line 78 which receives splatted arguments:
each_host_rows(host) do |*row|
To
each_host_rows(host) do |row|
yield('foo', 'bar', 'baz')
will yield'foo'
yield(['foo', 'bar', 'baz'])
will yield[foo', 'bar', 'baz']