Class: YARD::Logger
- Inherits:
-
Object
- Object
- YARD::Logger
- Defined in:
- lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb
Instance Method Summary collapse
- #show_progress ⇒ Object
-
#warn(warning) ⇒ Object
Redirect Yard command line warnings to a log file called .yardwarns Yard warnings may be irrelevant, spurious, or may not conform with our styling and UX design.
Instance Method Details
#show_progress ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb', line 33 def show_progress return false if YARD.ruby18? # threading is too ineffective for progress support return false if YARD.windows? # windows has poor ANSI support return false unless io.tty? # no TTY support on IO # Here is the actual monkey patch. A simple fix to an inverted conditional. # Without this Pry is unusable for debugging as the progress bar goes # craaaaaaaazy. return false unless level > INFO # no progress in verbose/debug modes @show_progress end |
#warn(warning) ⇒ Object
Redirect Yard command line warnings to a log file called .yardwarns Yard warnings may be irrelevant, spurious, or may not conform with our styling and UX design. They are also printed on stdout by default.
47 48 49 50 51 |
# File 'lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb', line 47 def warn warning f = File.new '.yardwarns', 'a' f.write warning f.close() end |