Rubocopification (unless ... else => if ... else, encoding, Multilines in {} block)
This commit is contained in:
@@ -48,7 +48,7 @@ class CustomOptionParser < OptionParser
|
||||
if option.is_a?(Array)
|
||||
option_symbol = CustomOptionParser::option_to_symbol(option)
|
||||
|
||||
unless @symbols_used.include?(option_symbol)
|
||||
if !@symbols_used.include?(option_symbol)
|
||||
@symbols_used << option_symbol
|
||||
|
||||
self.on(*option) do |arg|
|
||||
|
||||
@@ -6,14 +6,14 @@ describe '#vulnerabilities' do
|
||||
let(:location_url) { 'http://example.localhost/' }
|
||||
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_PLUGIN_DIR + '/vulnerabilities' }
|
||||
let(:vulns_file) { fixtures_dir + '/plugin_vulns.xml' }
|
||||
let(:wp_plugin) {
|
||||
let(:wp_plugin) do
|
||||
WpPlugin.new(
|
||||
base_url: location_url,
|
||||
name: 'spec-plugin',
|
||||
path: 'plugins/spec-plugin/',
|
||||
vulns_file: vulns_file
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
it 'should return an empty array when no vulnerabilities are found' do
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
# encoding: UTF-8
|
||||
|
||||
#--
|
||||
# WPScan - WordPress Security Scanner
|
||||
@@ -54,7 +55,7 @@ begin
|
||||
|
||||
# Check for updates
|
||||
if wpscan_options.update
|
||||
unless @updater.nil?
|
||||
if !@updater.nil?
|
||||
if @updater.has_local_changes?
|
||||
puts "#{red('[!]')} Local file changes detected, an update will override local changes, do you want to continue updating? [y/n]"
|
||||
Readline.readline =~ /^y/i ? @updater.reset_head : raise('Update aborted')
|
||||
@@ -216,7 +217,7 @@ begin
|
||||
puts green('[+]') + ' Enumerating plugins from passive detection ... '
|
||||
|
||||
plugins = wp_target.plugins_from_passive_detection(base_url: wp_target.uri, wp_content_dir: wp_target.wp_content_dir)
|
||||
unless plugins.empty?
|
||||
if !plugins.empty?
|
||||
puts "#{plugins.size} found :"
|
||||
|
||||
plugins.each do |plugin|
|
||||
@@ -251,7 +252,7 @@ begin
|
||||
}
|
||||
|
||||
plugins = wp_target.plugins_from_aggressive_detection(options)
|
||||
unless plugins.empty?
|
||||
if !plugins.empty?
|
||||
puts
|
||||
puts
|
||||
puts green('[+]') + " We found #{plugins.size.to_s} plugins:"
|
||||
@@ -295,7 +296,7 @@ begin
|
||||
}
|
||||
|
||||
themes = wp_target.themes_from_aggressive_detection(options)
|
||||
unless themes.empty?
|
||||
if !themes.empty?
|
||||
puts
|
||||
puts
|
||||
puts green('[+]') + " We found #{themes.size.to_s} themes:"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
# encoding: UTF-8
|
||||
|
||||
#--
|
||||
# WPScan - WordPress Security Scanner
|
||||
|
||||
Reference in New Issue
Block a user