File: verbose.rb

package info (click to toggle)
puppet-agent 8.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,404 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (20 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Support code for running stuff with warnings disabled or enabled
module Kernel
  def with_verbose_disabled
    verbose, $VERBOSE = $VERBOSE, nil
    begin
      yield
    ensure
      $VERBOSE = verbose
    end
  end

  def with_verbose_enabled
    verbose, $VERBOSE = $VERBOSE, true
    begin
      yield
    ensure
      $VERBOSE = verbose
    end
  end
end