mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-08-28 23:26:18 +02:00
![Luke Imhoff](/assets/img/avatar_default.png)
I missed a spot where I referenced the nested_paths as nested_pathnams after I renamed the variable. Now, Msf::ModuleManager#add_module_paths has rspec tests. Rspec can be invoked with `rake` as the default task or `rake spec` explicitly. I changed RuntimeError to ArgumentError since that error was more specific to having a bad argument error. I adding missing dependencies to the Gemfile and a require to msf/core/db_manager.rb where it errored out trying to access Msf::Config when I just did require 'msf/core' in the spec.
48 lines
1.3 KiB
Ruby
48 lines
1.3 KiB
Ruby
require 'bundler/setup'
|
|
|
|
require 'rspec/core/rake_task'
|
|
require 'yard'
|
|
|
|
RSpec::Core::RakeTask.new(:spec)
|
|
|
|
task :default => :spec
|
|
|
|
namespace :yard do
|
|
yard_files = [
|
|
# Ruby source files first
|
|
'lib/msf/**/*.rb',
|
|
'lib/rex/**/*.rb',
|
|
# Anything after '-' is a normal documentation, not source
|
|
'-',
|
|
'COPYING',
|
|
'HACKING',
|
|
'THIRD-PARTY.md'
|
|
]
|
|
yard_options = [
|
|
# include documentation for protected methods for developers extending the code.
|
|
'--protected'
|
|
]
|
|
|
|
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
t.files = yard_files
|
|
# --no-stats here as 'stats' task called after will print fuller stats
|
|
t.options = yard_options + ['--no-stats']
|
|
|
|
t.after = Proc.new {
|
|
Rake::Task['yard:stats'].execute
|
|
}
|
|
end
|
|
|
|
desc "Shows stats for YARD Documentation including listing undocumented modules, classes, constants, and methods"
|
|
task :stats => :environment do
|
|
stats = YARD::CLI::Stats.new
|
|
yard_arguments = yard_options + ['--compact', '--list-undoc'] + yard_files
|
|
stats.run *yard_arguments
|
|
end
|
|
end
|
|
|
|
# @todo Figure out how to just clone description from yard:doc
|
|
desc "Generate YARD documentation"
|
|
# allow calling namespace to as a task that goes to default task for namespace
|
|
task :yard => ['yard:doc']
|