2014-05-12 22:03:51 +02:00
|
|
|
#!/usr/bin/env rake
|
|
|
|
require File.expand_path('../config/application', __FILE__)
|
2014-07-30 17:10:20 +02:00
|
|
|
require 'metasploit/framework/require'
|
|
|
|
|
|
|
|
# @note must be before `Metasploit::Framework::Application.load_tasks`
|
|
|
|
#
|
|
|
|
# define db rake tasks from activerecord if activerecord is in the bundle. activerecord could be not in the bundle if
|
|
|
|
# the user installs with `bundle install --without db`
|
|
|
|
Metasploit::Framework::Require.optionally_active_record_railtie
|
2012-10-01 20:09:30 +02:00
|
|
|
|
2014-05-12 22:03:51 +02:00
|
|
|
Metasploit::Framework::Application.load_tasks
|
2014-10-21 20:46:39 +02:00
|
|
|
|
|
|
|
# append action to run after normal spec action
|
|
|
|
task :spec do
|
|
|
|
untested_payloads_pathname = Pathname.new 'log/untested-payloads.log'
|
|
|
|
|
|
|
|
if untested_payloads_pathname.exist?
|
|
|
|
$stderr.puts "Untested payload detected. Add tests to spec/modules/payload_spec.rb for payloads classes composed of the following payload modules:"
|
|
|
|
|
|
|
|
untested_payloads_pathname.open do |f|
|
|
|
|
f.each_line do |line|
|
|
|
|
$stderr.write " #{line}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
end
|