Rakefile in simp-rspec-puppet-facts-2.2.0 vs Rakefile in simp-rspec-puppet-facts-2.2.1
- old
+ new
@@ -1,5 +1,22 @@
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
rescue LoadError
end
+
+namespace :syntax do
+ def syntax_check(task, glob)
+ warn "---> #{task.name}"
+ Dir.glob(glob).map do |file|
+ puts '------| Attempting to load: ' + file
+ yield(file)
+ end
+ end
+
+ desc 'Syntax check for facts files under facts/'
+ task :facts do |t|
+ require 'json'
+ syntax_check(t, 'facts/**/*.facts') { |j| JSON.parse(File.read(j)) }
+ end
+end
+