Sha256: 9d3fdf097aa20309e9260828c9e1f76cd375c4938f3e463d796bd16f43b1e067

Contents?: true

Size: 970 Bytes

Versions: 169

Compression:

Stored size: 970 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

    Open3.popen3(RUBY, *option_list) {|inn, out, err, wait|
      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

169 entries across 153 versions & 58 rubygems

Version Path
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
lgrgic_palindrome_detector-0.2.0 vendor/cache/gems/lgrgic_palindrome_detector-0.1.0/vendor/cache/gems/rake-10.5.0/test/support/ruby_runner.rb
lgrgic_palindrome_detector-0.2.0 vendor/cache/gems/rake-10.5.0/test/support/ruby_runner.rb
lgrgic_palindrome_detector-0.1.0 vendor/cache/gems/rake-10.5.0/test/support/ruby_runner.rb
xaiml-0.1.1 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
xaiml-0.1.0 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.3.0 vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.3.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.2.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.2.0 vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.1.0 vendor/bundle/ruby/2.3.0/gems/wfrey_palindrome-0.1.0/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
wfrey_palindrome-0.1.0 vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
bsielski_control_flow-1.0.0 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
daslabs-0.12.0 vendor/cache/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
daslabs-0.11.0 vendor/cache/ruby/2.5.0/gems/rake-10.5.0/test/support/ruby_runner.rb
sprokovuln-0.2.0 vendor/ruby/gems/rake-10.5.0/test/support/ruby_runner.rb
mercadopago-custom-checkout-0.1.2 .gs/gems/rake-10.5.0/test/support/ruby_runner.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb
sb_prime_table-0.1.1 vendor/bundle/ruby/2.4.0/gems/rake-10.5.0/test/support/ruby_runner.rb
sb_prime_table-0.1.0 vendor/bundle/ruby/2.4.0/gems/rake-10.5.0/test/support/ruby_runner.rb