Class: Pedant::CheckParseTestCode
- Inherits:
-
Check
- Object
- Check
- Pedant::CheckParseTestCode
show all
- Defined in:
- lib/pedant/checks/parse_test_code.rb
Instance Attribute Summary
Attributes inherited from Check
#result
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Check
all, depends, #fail, #fatal, friendly_name, inherited, #initialize, initialize!, list, #pass, ready?, #report, run_checks_in_dependency_order, #skip, #warn
Constructor Details
This class inherits a constructor from Pedant::Check
Class Method Details
.provides ⇒ Object
33
34
35
|
# File 'lib/pedant/checks/parse_test_code.rb', line 33
def self.provides
super + [:trees]
end
|
.requires ⇒ Object
29
30
31
|
# File 'lib/pedant/checks/parse_test_code.rb', line 29
def self.requires
super + [:codes, :main, :test_mode]
end
|
Instance Method Details
#import(path) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/pedant/checks/parse_test_code.rb', line 38
def import(path)
file = path.basename
@kb[:trees][file] = :pending
tree = Nasl::Parser.new.parse(@kb[:codes][file], path)
@kb[:trees][file] = tree
report(:info, "Parsed contents of #{path}.")
end
|
#run ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/pedant/checks/parse_test_code.rb', line 37
def run
def import(path)
file = path.basename
@kb[:trees][file] = :pending
tree = Nasl::Parser.new.parse(@kb[:codes][file], path)
@kb[:trees][file] = tree
report(:info, "Parsed contents of #{path}.")
end
pass
@kb[:trees] = {}
import(@kb[:main])
end
|