Class | BoxGrinder::SilencerProxy |
In: |
lib/boxgrinder-build/helpers/guestfs-helper.rb
lib/boxgrinder-build/helpers/guestfs-helper.rb |
Parent: | Object |
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 27 27: def initialize(o, destination) 28: @o = o 29: @destination = destination 30: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 27 27: def initialize(o, destination) 28: @o = o 29: @destination = destination 30: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 32 32: def method_missing(m, *args, &block) 33: begin 34: redirect_streams(@destination) do 35: @o.send(m, *args, &block) 36: end 37: rescue 38: raise 39: end 40: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 32 32: def method_missing(m, *args, &block) 33: begin 34: redirect_streams(@destination) do 35: @o.send(m, *args, &block) 36: end 37: rescue 38: raise 39: end 40: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 46 46: def redirect_streams(destination) 47: old_stdout_stream = STDOUT.dup 48: old_stderr_stream = STDERR.dup 49: 50: STDOUT.reopen(destination) 51: STDERR.reopen(destination) 52: 53: STDOUT.sync = true 54: STDERR.sync = true 55: 56: yield 57: ensure 58: STDOUT.reopen(old_stdout_stream) 59: STDERR.reopen(old_stderr_stream) 60: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 46 46: def redirect_streams(destination) 47: old_stdout_stream = STDOUT.dup 48: old_stderr_stream = STDERR.dup 49: 50: STDOUT.reopen(destination) 51: STDERR.reopen(destination) 52: 53: STDOUT.sync = true 54: STDERR.sync = true 55: 56: yield 57: ensure 58: STDOUT.reopen(old_stdout_stream) 59: STDERR.reopen(old_stderr_stream) 60: end
# File lib/boxgrinder-build/helpers/guestfs-helper.rb, line 42 42: def respond_to?(m) 43: @o.respond_to?(m) 44: end