Method: Chef::RunContext#open_stream
- Defined in:
- lib/chef/run_context.rb
permalink #open_stream(name: nil, **options) {|stream| ... } ⇒ EventDispatch::EventsOutputStream
Open a stream object that can be printed into and will dispatch to events
620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/chef/run_context.rb', line 620 def open_stream(name: nil, **) stream = EventDispatch::EventsOutputStream.new(events, name: name, **) if block_given? begin yield stream ensure stream.close end else stream end end |