2019-05-19 19:12:26 -05:00
|
|
|
require 'require_all'
|
|
|
|
|
|
|
|
class Array
|
|
|
|
# group elements by their identity, and count each distinct item
|
|
|
|
def counts
|
|
|
|
group_by(&:itself).map {|k,v| [k, v.count] }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if defined?(PryByebug)
|
|
|
|
Pry.commands.alias_command 'c', 'continue'
|
|
|
|
Pry.commands.alias_command 's', 'step'
|
|
|
|
Pry.commands.alias_command 'n', 'next'
|
|
|
|
Pry.commands.alias_command 'f', 'finish'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Hit Enter to repeat last command
|
|
|
|
Pry::Commands.command /^$/, "repeat last command" do
|
|
|
|
_pry_.run_command Pry.history.to_a.last
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Obtain the present woking directory
|
|
|
|
current_dir = Dir.pwd
|
|
|
|
|
|
|
|
if current_dir =~ /^(.*?\/misc_rbtools)/
|
|
|
|
require_all './modules'
|
|
|
|
require_all './classes'
|
|
|
|
end
|
|
|
|
|
|
|
|
nvd_downloader = NvdTools::NvdDownloader.new
|
|
|
|
scans_io_downloader = ScansIoTools::ScansIoDownloader.new
|
|
|
|
scans_io_parser = ScansIoTools::ScansIoIndexParser.new(scans_io_downloader.get_json_index.body)
|
|
|
|
|