Module: RubyGPG2::Commands::Mixins::WithCapturedStatus
- Included in:
- GenerateKey, Import
- Defined in:
- lib/ruby_gpg2/commands/mixins/with_captured_status.rb
Instance Method Summary collapse
Instance Method Details
#do_after(opts) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ruby_gpg2/commands/mixins/with_captured_status.rb', line 21 def do_after(opts) parse_status = opts[:parse_status].nil? ? true : opts[:parse_status] if opts[:with_status] super(opts.merge( status: parse_status ? StatusOutput.parse(@status) : @status)) else super(opts) end end |
#do_around(opts) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_gpg2/commands/mixins/with_captured_status.rb', line 9 def do_around(opts) if opts[:with_status] Tempfile.create( 'status-file', opts[:work_directory]) do |f| yield opts.merge(status_file: f.path) @status = File.read(f.path) end else yield opts end end |