Class: RequireProfiler::Printer::Base
- Inherits:
-
Object
- Object
- RequireProfiler::Printer::Base
- Defined in:
- lib/require_profiler/printer.rb
Instance Method Summary collapse
- #finish ⇒ Object
- #flush(node) ⇒ Object
-
#initialize(output) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(output) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/require_profiler/printer.rb', line 9 def initialize(output) @output = output # Identify prefixes for the project and the gems prefixes = [::Dir.pwd] prefixes << ::Gem.dir if defined?(::Gem.dir) prefixes << ::Bundler.bundle_path if defined?(::Bundler.bundle_path) @prefix_stripper = %r{^(#{prefixes.join("|")})/} end |
Instance Method Details
#finish ⇒ Object
24 25 26 |
# File 'lib/require_profiler/printer.rb', line 24 def finish output.close if output.respond_to?(:close) && output != $stdout end |
#flush(node) ⇒ Object
20 21 22 |
# File 'lib/require_profiler/printer.rb', line 20 def flush(node) raise NotImplementedError end |