Skip to content

Commit

Permalink
Merge pull request #66 from cmurphy/add_validate
Browse files Browse the repository at this point in the history
Add :validate as a rake task
  • Loading branch information
hunner committed Jun 30, 2014
2 parents 3887c1e + eb9ab98 commit 4e00240
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,19 @@ def revision(scm, target, ref)
end
end

desc "Validate manifests, templates, and ruby files in lib."
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['lib/**/*.rb'].each do |lib_file|
sh "ruby -c #{lib_file}"
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

desc "Display the list of available rake tasks"
task :help do
system("rake -T")
Expand Down

0 comments on commit 4e00240

Please sign in to comment.