# File lib/chef/cookbook/syntax_check.rb, line 122 def validate_ruby_file(ruby_file) Chef::Log.debug("Testing #{ruby_file} for syntax errors...") result = shell_out("ruby -c #{ruby_file}") result.error! true rescue Mixlib::ShellOut::ShellCommandFailed file_relative_path = ruby_file[/^#{Regexp.escape(cookbook_path+File::Separator)}(.*)/, 1] Chef::Log.fatal("Cookbook file #{file_relative_path} has a ruby syntax error:") result.stderr.each_line { |l| Chef::Log.fatal(l.chomp) } false end