Class: Codeqa::Checkers::CheckRubySyntax
Instance Attribute Summary
#errors, #sourcefile
Class Method Summary
collapse
Instance Method Summary
collapse
available?, #initialize
Class Method Details
.check?(sourcefile) ⇒ Boolean
5
6
7
|
# File 'lib/codeqa/checkers/check_ruby_syntax.rb', line 5
def self.check?(sourcefile)
sourcefile.ruby?
end
|
Instance Method Details
#check ⇒ Object
17
18
19
20
21
22
|
# File 'lib/codeqa/checkers/check_ruby_syntax.rb', line 17
def check
with_existing_file do |filename|
command = "/usr/bin/env ruby -c '#{filename}' 1>/dev/null 2>/dev/null"
errors.add(nil, 'Ruby syntax error') unless system(command)
end
end
|
#hint ⇒ Object
13
14
15
|
# File 'lib/codeqa/checkers/check_ruby_syntax.rb', line 13
def hint
'Ruby can not parse the file, please check it for syntax errors.'
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/codeqa/checkers/check_ruby_syntax.rb', line 9
def name
'ruby syntax'
end
|