Sha256: a21a78f0bd0a4c06d5b5360f42d0dc469784810994fd05bfd4827859b356cb4a

Contents?: true

Size: 382 Bytes

Versions: 2

Compression:

Stored size: 382 Bytes

Contents

require 'stringio'

module Kernel
  def command_result(command)
    output = StringIO.new
    pager = Pry.config.pager
    color = Pry.config.color
    Pry.config.pager = false
    Pry.config.color = false
    Pry.run_command(command, output: output, show_output: true)
    output.string
  ensure
    Pry.config.color = color
    Pry.config.pager = pager
    output.close
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pry-command_result-0.0.3 lib/pry-command_result/kernel_ext.rb
pry-command_result-0.0.2 lib/pry-command_result/kernel_ext.rb