Indentatio
This commit is contained in:
@@ -13,13 +13,13 @@ class CheckerSpelling < Plugin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def spellcheck
|
def spellcheck
|
||||||
mistakes = 0
|
mistakes = 0
|
||||||
|
|
||||||
puts '[+] Checking for spelling mistakes'
|
puts '[+] Checking for spelling mistakes'
|
||||||
puts
|
puts
|
||||||
|
|
||||||
files.each do |file_name|
|
files.each do |file_name|
|
||||||
if File.exists?(file_name)
|
if File.exists?(file_name)
|
||||||
file = File.open(file_name, 'r')
|
file = File.open(file_name, 'r')
|
||||||
|
|
||||||
misspellings.each_key do |misspelling|
|
misspellings.each_key do |misspelling|
|
||||||
@@ -28,10 +28,10 @@ class CheckerSpelling < Plugin
|
|||||||
mistakes += 1
|
mistakes += 1
|
||||||
puts "[MISSPELLING] File: #{file_name} Bad: #{match} Good: #{misspellings[misspelling]}"
|
puts "[MISSPELLING] File: #{file_name} Bad: #{match} Good: #{misspellings[misspelling]}"
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
puts "Error in #{file_name} #{e}"
|
puts "Error in #{file_name} #{e}"
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
file.close
|
file.close
|
||||||
@@ -45,47 +45,47 @@ class CheckerSpelling < Plugin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def misspellings
|
def misspellings
|
||||||
{
|
{
|
||||||
/databse/i => 'database',
|
/databse/i => 'database',
|
||||||
/whith/i => 'with',
|
/whith/i => 'with',
|
||||||
/wich/i => 'which',
|
/wich/i => 'which',
|
||||||
/verions/i => 'versions',
|
/verions/i => 'versions',
|
||||||
/vulnerabilitiy/i => 'vulnerability',
|
/vulnerabilitiy/i => 'vulnerability',
|
||||||
/unkown/i => 'unknown',
|
/unkown/i => 'unknown',
|
||||||
/recieved/i => 'received',
|
/recieved/i => 'received',
|
||||||
/acheive/i => 'achieve',
|
/acheive/i => 'achieve',
|
||||||
/wierd/i => 'weird',
|
/wierd/i => 'weird',
|
||||||
/untill/i => 'until',
|
/untill/i => 'until',
|
||||||
/alot/i => 'a lot',
|
/alot/i => 'a lot',
|
||||||
/randomstorm/ => 'RandomStorm',
|
/randomstorm/ => 'RandomStorm',
|
||||||
/wpscan/ => 'WPScan',
|
/wpscan/ => 'WPScan',
|
||||||
/Wordpress/ => 'WordPress'
|
/Wordpress/ => 'WordPress'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def files
|
def files
|
||||||
files = Dir['**/*'].reject {|fn| File.directory?(fn) }
|
files = Dir['**/*'].reject {|fn| File.directory?(fn) }
|
||||||
|
|
||||||
ignore.each do |ignore|
|
ignore.each do |ignore|
|
||||||
files.delete_if { |data| data.match(ignore) }
|
files.delete_if { |data| data.match(ignore) }
|
||||||
end
|
end
|
||||||
|
|
||||||
files
|
files
|
||||||
end
|
end
|
||||||
|
|
||||||
def ignore
|
def ignore
|
||||||
ignore = []
|
ignore = []
|
||||||
|
|
||||||
ignore << File.basename(__FILE__)
|
ignore << File.basename(__FILE__)
|
||||||
ignore << 'spec/cache/'
|
ignore << 'spec/cache/'
|
||||||
ignore << 'spec/spec_session/'
|
ignore << 'spec/spec_session/'
|
||||||
ignore << 'cache/'
|
ignore << 'cache/'
|
||||||
ignore << 'coverage/'
|
ignore << 'coverage/'
|
||||||
ignore << 'wordlist-iso-8859-1'
|
ignore << 'wordlist-iso-8859-1'
|
||||||
ignore << 'log.txt'
|
ignore << 'log.txt'
|
||||||
ignore << 'debug.log'
|
ignore << 'debug.log'
|
||||||
ignore << 'wordlist.txt'
|
ignore << 'wordlist.txt'
|
||||||
|
|
||||||
ignore
|
ignore
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user