Skip to content

Commit 6001b25

Browse files
committed
update librarian syntax check to match ruby
1 parent 65e2ac2 commit 6001b25

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/puppet-check/ruby_parser.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def self.librarian(files, style, rc_args)
7979

8080
files.each do |file|
8181
# check librarian puppet syntax
82-
# prevents ruby code from actually executing the input ruby file
83-
catch(:good) { instance_eval("BEGIN {throw :good}; #{File.read(file)} # BEGIN {throw :good}; ruby_file_content", file) }
82+
RubyVM::InstructionSequence.compile_file(file)
8483
rescue SyntaxError, LoadError, ArgumentError => err
8584
PuppetCheck.files[:errors][file] = err.to_s.gsub("#{file}:", '').split("\n")
8685
# check librarian puppet style

0 commit comments

Comments
 (0)