Class: Pippi::ExecRunner
- Inherits:
-
Object
- Object
- Pippi::ExecRunner
- Defined in:
- lib/pippi/exec_runner.rb
Instance Attribute Summary collapse
-
#check_name ⇒ Object
Returns the value of attribute check_name.
-
#code_to_eval ⇒ Object
Returns the value of attribute code_to_eval.
-
#codefile ⇒ Object
Returns the value of attribute codefile.
-
#output_file_name ⇒ Object
Returns the value of attribute output_file_name.
Instance Method Summary collapse
- #dump_report(ctx) ⇒ Object
-
#initialize(args) ⇒ ExecRunner
constructor
A new instance of ExecRunner.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ ExecRunner
Returns a new instance of ExecRunner.
5 6 7 8 9 10 11 |
# File 'lib/pippi/exec_runner.rb', line 5 def initialize(args) check_args(args) @codefile = args[0] @check_name = args[1] @code_to_eval = args[2] @output_file_name = args[3] end |
Instance Attribute Details
#check_name ⇒ Object
Returns the value of attribute check_name.
3 4 5 |
# File 'lib/pippi/exec_runner.rb', line 3 def check_name @check_name end |
#code_to_eval ⇒ Object
Returns the value of attribute code_to_eval.
3 4 5 |
# File 'lib/pippi/exec_runner.rb', line 3 def code_to_eval @code_to_eval end |
#codefile ⇒ Object
Returns the value of attribute codefile.
3 4 5 |
# File 'lib/pippi/exec_runner.rb', line 3 def codefile @codefile end |
#output_file_name ⇒ Object
Returns the value of attribute output_file_name.
3 4 5 |
# File 'lib/pippi/exec_runner.rb', line 3 def output_file_name @output_file_name end |
Instance Method Details
#dump_report(ctx) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pippi/exec_runner.rb', line 21 def dump_report(ctx) File.open(output_file_name, 'w') do |outfile| ctx.report.problems.each do |problem| outfile.syswrite("#{problem.to_text}\n") end end end |
#run ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pippi/exec_runner.rb', line 13 def run ctx = Pippi::Context.new CheckLoader.new(ctx, check_name).checks.each(&:decorate) load "#{codefile}" eval code_to_eval dump_report ctx end |