module Fastlane

def with_captured_stdout

original_stdout = FastlaneCore::UI.ui_object
str = ''
ci_output = FastlaneCI::FastlaneCIOutput.new(
    each_line_block: proc do |raw_row|
      str = str + raw_row
    end
)

FastlaneCore::UI.ui_object = ci_output
yield
str

ensure

FastlaneCore::UI.ui_object = original_stdout

end

Constants

UI