summaryrefslogtreecommitdiff
path: root/lib/irb/cmd/measure.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/cmd/measure.rb')
-rw-r--r--lib/irb/cmd/measure.rb43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/irb/cmd/measure.rb b/lib/irb/cmd/measure.rb
deleted file mode 100644
index adea540e92..0000000000
--- a/lib/irb/cmd/measure.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require_relative "nop"
-
-# :stopdoc:
-module IRB
- module ExtendCommand
- class Measure < Nop
- def initialize(*args)
- super(*args)
- end
-
- def execute(type = nil, arg = nil, &block)
- # Please check IRB.init_config in lib/irb/init.rb that sets
- # IRB.conf[:MEASURE_PROC] to register default "measure" methods,
- # "measure :time" (abbreviated as "measure") and "measure :stackprof".
- case type
- when :off
- IRB.conf[:MEASURE] = nil
- IRB.unset_measure_callback(arg)
- when :list
- IRB.conf[:MEASURE_CALLBACKS].each do |type_name, _, arg_val|
- puts "- #{type_name}" + (arg_val ? "(#{arg_val.inspect})" : '')
- end
- when :on
- IRB.conf[:MEASURE] = true
- added = IRB.set_measure_callback(type, arg)
- puts "#{added[0]} is added." if added
- else
- if block_given?
- IRB.conf[:MEASURE] = true
- added = IRB.set_measure_callback(&block)
- puts "#{added[0]} is added." if added
- else
- IRB.conf[:MEASURE] = true
- added = IRB.set_measure_callback(type, arg)
- puts "#{added[0]} is added." if added
- end
- end
- nil
- end
- end
- end
-end
-# :startdoc: