lib/vedeu/support/trace.rb in vedeu-0.2.3 vs lib/vedeu/support/trace.rb in vedeu-0.2.4
- old
+ new
@@ -6,11 +6,10 @@
# excruciatingly slow to run.
#
# @api private
class Trace
- # :nocov:
# @param options [Hash]
# @return []
def self.call(options = {})
new(options).trace
end
@@ -50,22 +49,20 @@
private
# Writes the message to the log file.
#
- # @api private
# @param message [String]
# @return [Boolean]
def log_this(message)
Vedeu::Log.logger.debug(message)
end
# Provides inspection of the local variables set within the method being
# traced. Makes the log file extremely noisy, but very useful for hunting
# down bugs.
#
- # @api private
# @param binding [Class]
# @return [String]
def variables(binding)
entries = []
binding.eval('local_variables').each do |var|
@@ -82,29 +79,25 @@
content)
end
entries.join("\n")
end
- # @api private
# @return [String]
def watched
options[:event]
end
- # @api private
# @return [Boolean]
def trace?
options[:trace]
end
- # @api private
# @return [Hash]
def options
defaults.merge!(@options)
end
- # @api private
# @return [Hash]
def defaults
{
trace: Vedeu::Configuration.trace?,
event: 'call',
@@ -130,11 +123,10 @@
@_count ||= "(#{classes.size.to_s}/#{vedeu_classes.size.to_s})"
end
# Returns the classes to be traced, without exceptions or ignored classes.
#
- # @api private
# @return [Set]
def classes
@_classes ||= vedeu_classes - vedeu_exceptions - ignored_classes
end
@@ -153,11 +145,10 @@
#
# @return [Set]
def vedeu_exceptions
Set.new [
'Vedeu::BufferNotFound',
- 'Vedeu::CursorNotFound',
'Vedeu::GroupNotFound',
'Vedeu::InterfaceNotFound',
'Vedeu::InvalidSyntax',
'Vedeu::KeyInUse',
'Vedeu::MenuNotFound',
@@ -225,11 +216,9 @@
'Vedeu::Trace',
# 'Vedeu::View',
# 'Vedeu::Viewport',
]
end
-
- # :nocov:
end # Trace
end # Vedeu