Class: RubyMemcheck::RubyRunner
- Inherits:
-
Object
- Object
- RubyMemcheck::RubyRunner
- Defined in:
- lib/ruby_memcheck/ruby_runner.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(*args) ⇒ RubyRunner
constructor
A new instance of RubyRunner.
- #run(*args, **options) ⇒ Object
Constructor Details
#initialize(*args) ⇒ RubyRunner
Returns a new instance of RubyRunner.
8 9 10 11 12 13 14 15 |
# File 'lib/ruby_memcheck/ruby_runner.rb', line 8 def initialize(*args) @configuration = if !args.empty? && args[0].is_a?(Configuration) args.shift else RubyMemcheck.default_configuration end end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/ruby_memcheck/ruby_runner.rb', line 5 def configuration @configuration end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
6 7 8 |
# File 'lib/ruby_memcheck/ruby_runner.rb', line 6 def reporter @reporter end |
Instance Method Details
#run(*args, **options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ruby_memcheck/ruby_runner.rb', line 17 def run(*args, **) command = configuration.command(args.map { |a| Shellwords.escape(a) }) @reporter = TestTaskReporter.new(configuration) @reporter.setup system(command, ) exit_code = $CHILD_STATUS.exitstatus @reporter.report_valgrind_errors exit_code end |