Sha256: 2b3a44745312214b451044e3f7ea573dcefff7de2f0ea985bac7cdf2f55f889e
Contents?: true
Size: 644 Bytes
Versions: 17
Compression:
Stored size: 644 Bytes
Contents
# encoding: UTF-8 require 'gooddata/cli/cli' module CliHelper # Execute block and capture its stdou # @param block Block to be executed with stdout redirected # @returns Captured output as string def capture_stdout(&block) original_stdout = $stdout $stdout = fake = StringIO.new begin yield ensure $stdout = original_stdout end fake.string end # Run CLI with arguments and return captured stdout # @param args Arguments # @return Captured stdout def run_cli(args = []) old = $0 $0 = 'gooddata' res = capture_stdout { GoodData::CLI.main(args) } $0 = old res end end
Version data entries
17 entries across 17 versions & 1 rubygems