Sha256: bbc9e9160822948c2062118d36eecc332b5e2b9b6f0461cf5faeddd22632854d

Contents?: true

Size: 955 Bytes

Versions: 87

Compression:

Stored size: 955 Bytes

Contents

module RubyRunner
  include FileUtils

  # Run a shell Ruby command with command line options (using the
  # default test options). Output is captured in @out and @err
  def ruby(*option_list)
    run_ruby(@ruby_options + option_list)
  end

  # Run a command line rake with the give rake options.  Default
  # command line ruby options are included.  Output is captured in
  # @out and @err
  def rake(*rake_options)
    run_ruby @ruby_options + [@rake_exec] + rake_options
  end

  # Low level ruby command runner ...
  def run_ruby(option_list)
    puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose

    inn, out, err, wait = Open3.popen3(RUBY, *option_list)
    inn.close

    @exit = wait ? wait.value : $?
    @out = out.read
    @err = err.read

    puts "OUTPUT:  [#{@out}]" if @verbose
    puts "ERROR:   [#{@err}]" if @verbose
    puts "EXIT:    [#{@exit.inspect}]" if @verbose
    puts "PWD:     [#{Dir.pwd}]" if @verbose
  end
end

Version data entries

87 entries across 79 versions & 17 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rake-10.3.2/test/support/ruby_runner.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.9 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/rake-10.3.2/test/support/ruby_runner.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.8 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.7 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.6 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.5 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.4 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.3 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.2 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
allegro_api_client-0.0.1 gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
nanumfont-rails-0.1 vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb
spline-0.0.11 vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb