Module: IrbBenchmark

Defined in:
lib/irb_benchmark.rb

Overview

Main IrbBenchmark module, which has to be injected into IRB::Context.

Constant Summary collapse

VERSION =
File.read(File.expand_path('../../VERSION', __FILE__)).chomp.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.enabledObject

Returns the value of attribute enabled.



8
9
10
# File 'lib/irb_benchmark.rb', line 8

def enabled
  @enabled
end

Class Method Details



10
11
12
13
14
15
16
# File 'lib/irb_benchmark.rb', line 10

def print(bm)
  if defined?(Wirb) && (!defined?(FancyIrb) || FancyIrb[:colorize, :output])
    $stdout.print Wirb.colorize_result bm.to_s
  else
    $stdout.print bm.to_s
  end
end