require 'tempfile' require_relative '../../status_output' module RubyGPG2 module Commands module Mixins module WithCapturedStatus def do_around(opts) if opts[:with_status] Tempfile.create do |f| yield opts.merge(status_file: f.path) @status = File.read(f.path) end else yield opts end end def do_after(opts) if opts[:with_status] super(opts.merge( status: StatusOutput.parse(@status))) else super(opts) end end end end end end