forked from rapid7/metasploit-framework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rapid7#1563 from rapid7/bug/yard-guard
[Story #45771305] Conflicts: Rakefile
- Loading branch information
Showing
203 changed files
with
162 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--protected | ||
--exclude samples/ | ||
--exclude \.ut\.rb/ | ||
--exclude \.ts\.rb/ | ||
--files CONTRIBUTING.md,COPYING,HACKING,LICENSE | ||
lib/msf/**/*.rb | ||
lib/rex/**/*.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,49 @@ | ||
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', | ||
'LICENSE', | ||
'CONTRIBUTING.md', | ||
] | ||
yard_options = [ | ||
# include documentation for protected methods for developers extending the code. | ||
'--protected', | ||
# Don't bother with files meant to be examples | ||
'--exclude', 'samples/', | ||
'--exclude', '\.ut\.rb/', | ||
'--exclude', '\.ts\.rb/', | ||
] | ||
|
||
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 | ||
require 'metasploit_data_models' | ||
|
||
print_without = false | ||
|
||
begin | ||
require 'rspec/core/rake_task' | ||
rescue LoadError | ||
puts "rspec not in bundle, so can't set up spec tasks. " \ | ||
"To run specs ensure to install the development and test groups." | ||
|
||
print_without = true | ||
else | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec | ||
end | ||
|
||
begin | ||
require 'yard' | ||
rescue LoadError | ||
puts "yard not in bundle, so can't set up yard tasks. " \ | ||
"To generate documentation ensure to install the development group." | ||
|
||
print_without = true | ||
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'] | ||
metasploit_data_models_task_glob = MetasploitDataModels.root.join( | ||
'lib', | ||
'tasks', | ||
'**', | ||
'*.rake' | ||
).to_s | ||
|
||
# include tasks from metasplioit_data_models, such as `rake yard`. | ||
# metasploit-framework specific yard options are in .yardopts | ||
Dir.glob(metasploit_data_models_task_glob) do |path| | ||
load path | ||
end | ||
|
||
if print_without | ||
puts "Bundle currently installed " \ | ||
"'--without #{Bundler.settings.without.join(' ')}'." | ||
puts "To clear the without option do `bundle install --without ''` " \ | ||
"(the --without flag with an empty string) or " \ | ||
"`rm -rf .bundle` to remove the .bundle/config manually and " \ | ||
"then `bundle install`" | ||
end |
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
lib/gemcache/ruby/1.9.1/gems/metasploit_data_models-0.6.0/Rakefile
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...emcache/ruby/1.9.1/gems/metasploit_data_models-0.6.0/lib/metasploit_data_models/engine.rb
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
lib/gemcache/ruby/1.9.1/gems/metasploit_data_models-0.6.0/lib/tasks/yard.rake
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions
53
lib/gemcache/ruby/1.9.1/gems/metasploit_data_models-0.6.1/Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env rake | ||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
print_without = false | ||
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__) | ||
|
||
begin | ||
load 'rails/tasks/engine.rake' | ||
rescue LoadError | ||
puts "railties not in bundle, so can't load engine tasks." | ||
print_without = true | ||
end | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
# | ||
# load rake files like a normal rails app | ||
# @see http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl | ||
# | ||
|
||
pathname = Pathname.new(__FILE__) | ||
root = pathname.parent | ||
rakefile_glob = root.join('lib', 'tasks', '**', '*.rake').to_path | ||
|
||
Dir.glob(rakefile_glob) do |rakefile| | ||
load rakefile | ||
end | ||
|
||
begin | ||
require 'rspec/core' | ||
rescue LoadError | ||
puts "rspec not in bundle, so can't set up spec tasks. " \ | ||
"To run specs ensure to install the development and test groups." | ||
print_without = true | ||
else | ||
require 'rspec/core/rake_task' | ||
|
||
# Depend on app:db:test:prepare so that test database is recreated just like in a full rails app | ||
# @see http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl | ||
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare') | ||
|
||
task :default => :spec | ||
end | ||
|
||
if print_without | ||
puts "Bundle currently installed '--without #{Bundler.settings.without.join(' ')}'." | ||
puts "To clear the without option do `bundle install --without ''` (the --without flag with an empty string) or " \ | ||
"`rm -rf .bundle` to remove the .bundle/config manually and then `bundle install`" | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...emcache/ruby/1.9.1/gems/metasploit_data_models-0.6.1/lib/metasploit_data_models/engine.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'rails' | ||
|
||
module MetasploitDataModels | ||
class Engine < Rails::Engine | ||
# @see http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl | ||
config.generators do |g| | ||
g.assets false | ||
g.fixture_replacement :factory_girl, :dir => 'spec/factories' | ||
g.helper false | ||
g.test_framework :rspec, :fixture => false | ||
end | ||
|
||
initializer 'metasploit_data_models.prepend_factory_path', :after => 'factory_girl.set_factory_paths' do | ||
if defined? FactoryGirl | ||
relative_definition_file_path = config.generators.options[:factory_girl][:dir] | ||
definition_file_path = root.join(relative_definition_file_path) | ||
|
||
# unshift so that Pro can modify mdm factories | ||
FactoryGirl.definition_file_paths.unshift definition_file_path | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
lib/gemcache/ruby/1.9.1/gems/metasploit_data_models-0.6.1/lib/tasks/yard.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# @note All options not specific to any given rake task should go in the .yardopts file so they are available to both | ||
# the below rake tasks and when invoking `yard` from the command line | ||
|
||
if defined? YARD | ||
namespace :yard do | ||
YARD::Rake::YardocTask.new(:doc) do |t| | ||
# --no-stats here as 'stats' task called after will print fuller stats | ||
t.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 | ||
stats.run('--compact', '--list-undoc') | ||
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'] | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters