Sha256: 38686c7af8c0401183846c8ffba7be4b13d702bfa8edac233e9e993c97096ffb

Contents?: true

Size: 574 Bytes

Versions: 27

Compression:

Stored size: 574 Bytes

Contents

require 'stringio'

module RubyGPG2
  module Commands
    module Mixins
      module WithCapturedOutput
        def initialize(*args)
          super(*args)
          @stdout = StringIO.new unless
              (defined?(@stdout) && @stdout.respond_to?(:string))
        end

        def do_after(opts)
          parse_output = opts[:parse_output].nil? ? true : opts[:parse_output]
          super(opts.merge(
              output: parse_output ?
                  ColonOutput.parse(stdout.string) :
                  stdout.string))
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ruby_gpg2-0.9.0.pre.6 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.9.0.pre.5 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.9.0.pre.4 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.9.0.pre.3 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.9.0.pre.2 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.9.0.pre.1 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.8.0 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.7.0.pre.1 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.6.0 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.5.0.pre.1 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.4.0 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.3.0.pre.2 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.3.0.pre.1 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.2.0 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.27 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.26 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.25 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.24 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.23 lib/ruby_gpg2/commands/mixins/with_captured_output.rb
ruby_gpg2-0.1.0.pre.22 lib/ruby_gpg2/commands/mixins/with_captured_output.rb