-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add method for returning the version information for each scan engine #212
Conversation
|
||
versions << engdata | ||
end | ||
|
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.
Trailing whitespace detected.
Hi @Red5d, thank you for the contribution! This looks handy so we'll take a look at it today. In the mean time it would be nice to see a description, or at least an example of what using this looks like, for the benefit of others that aren't familiar with the output being parsed here. Not a blocker to getting this merged, though! |
@gschneider-r7 Sure, do you want the example in the comments above the code? |
eng.split(/\n/).each do |kv| | ||
key, value = kv.split(/:\s*/) | ||
key = key.sub('Local Engine ', '').sub('Remote Engine ', '') | ||
if key != 'VERSION INFORMATION' |
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.
i think for this i'd rather see the following:
next if key == 'VERSION INFORMATION'
or we could just gsub out 'VERSION INFORMATION'
from the string.
Since we know it should always be in the string, and we know we don't want it, it might be easier to just gsub it out, and avoid the if
statement all together.
But either way thank you for this @Red5d , this is pretty awesome that you took the time to submit the PR!
def engine_versions | ||
info = console_command('version engines') | ||
versions = [] | ||
engines = info.sub("VERSION INFORMATION\n", "").split(/\n\n/) |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
@sgreen-r7 , I've changed the if statement to a .sub |
radical! thank you @Red5d we'll probably go ahead and merge this in, and release it tomorrow - 4/6 |
No description provided.