Rakefile 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env rake
  2. require File.expand_path('../config/application', __FILE__)
  3. require 'msfenv'
  4. require 'metasploit/framework/require'
  5. require 'metasploit/framework/spec/untested_payloads'
  6. # @note must be before `Metasploit::Framework::Application.load_tasks`
  7. #
  8. # define db rake tasks from activerecord if activerecord is in the bundle. activerecord could be not in the bundle if
  9. # the user installs with `bundle install --without db`
  10. Metasploit::Framework::Require.optionally_active_record_railtie
  11. begin
  12. require 'rspec/core'
  13. require 'rspec-rerun/tasks'
  14. rescue LoadError
  15. puts "rspec not in bundle, so can't set up spec tasks. " \
  16. "To run specs ensure to install the development and test groups."
  17. puts "Bundle currently installed '--without #{Bundler.settings.without.join(' ')}'."
  18. puts "To clear the without option do `bundle install --without ''` (the --without flag with an empty string) or " \
  19. "`rm -rf .bundle` to remove the .bundle/config manually and then `bundle install`"
  20. else
  21. require 'rspec/core/rake_task'
  22. RSpec::Core::RakeTask.new(spec: 'db:test:prepare')
  23. end
  24. Metasploit::Framework::Application.load_tasks
  25. Metasploit::Framework::Spec::Constants.define_task
  26. Metasploit::Framework::Spec::Threads::Suite.define_task
  27. Metasploit::Framework::Spec::UntestedPayloads.define_task