31 lines
		
	
	
		
			855 B
		
	
	
	
		
			Ruby
		
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			855 B
		
	
	
	
		
			Ruby
		
	
	
	
| require 'puppetlabs_spec_helper/rake_tasks'
 | |
| 
 | |
| defaults = [:validate, :spec]
 | |
| begin
 | |
|   if Gem::Specification::find_by_name('metadata-json-lint')
 | |
|     defaults = defaults.insert(0, :metadata_lint)
 | |
|   end
 | |
|   if Gem::Specification::find_by_name('puppet-lint')
 | |
|     require 'puppet-lint/tasks/puppet-lint'
 | |
|     exclude_paths = [
 | |
|       'bundle/**/*',
 | |
|       'pkg/**/*',
 | |
|       'vendor/**/*',
 | |
|       'spec/**/*'
 | |
|     ]
 | |
|     Rake::Task[:lint].clear
 | |
|     PuppetLint::RakeTask.new :lint do |config|
 | |
|       config.ignore_paths = exclude_paths
 | |
|     end
 | |
|     defaults = defaults.insert(-2, :lint)
 | |
|   end
 | |
| end
 | |
| task :test => defaults
 | |
| 
 | |
| task :docs do
 | |
|   require 'puppet-strings'
 | |
|   # Remove TOC, as YARD generates its own
 | |
|   sh "sed -i '/# aegir/,/## Description/{//!d}' README.md"
 | |
|   PuppetStrings.generate(PuppetStrings::DEFAULT_SEARCH_PATTERNS, { :yard_args => ['--output-dir=public'] })
 | |
| end
 |