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
plyom_user-0.1.2 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.1.1 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.1.0 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.9 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.8 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.7 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.6 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.5 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.4 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.3 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
plyom_user-0.0.2 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/test/support/ruby_runner.rb
rake-10.1.1 test/support/ruby_runner.rb
social_url_stats-0.0.1 vendor/ruby/1.9.1/gems/rake-10.1.0/test/support/ruby_runner.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
bundle_depot-0.2.2 fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
bundle_depot-0.2.1 fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
bundle_depot-0.2.0 fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
bundle_depot-0.0.3 fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb
bundle_depot-0.0.2 fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb