module SuperDiff
Source: <en.wikipedia.org/wiki/ANSI_escape_code>
Constants
- VERSION
Public Class Methods
configuration()
click to toggle source
# File lib/super_diff.rb, line 35 def self.configuration @_configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
# File lib/super_diff.rb, line 30 def self.configure yield configuration configuration.updated end
insert_overrides(target_module, mod = nil, &block)
click to toggle source
# File lib/super_diff.rb, line 69 def self.insert_overrides(target_module, mod = nil, &block) if mod target_module.prepend(mod) else target_module.prepend(Module.new(&block)) end end
insert_singleton_overrides(target_module, mod = nil, &block)
click to toggle source
# File lib/super_diff.rb, line 77 def self.insert_singleton_overrides(target_module, mod = nil, &block) if mod target_module.singleton_class.prepend(mod) else target_module.singleton_class.prepend(Module.new(&block)) end end
inspect_object(object, as_lines:, **rest)
click to toggle source
# File lib/super_diff.rb, line 39 def self.inspect_object(object, as_lines:, **rest) SuperDiff::RecursionGuard.guarding_recursion_of(object) do inspection_tree = ObjectInspection::InspectionTreeBuilders::Main.call( object ) if as_lines inspection_tree.render_to_lines(object, **rest) else inspection_tree.render_to_string(object) end end end
primitive?(value)
click to toggle source
# File lib/super_diff.rb, line 60 def self.primitive?(value) case value when true, false, nil, Symbol, Numeric, Regexp, Class true else false end end
time_like?(value)
click to toggle source
# File lib/super_diff.rb, line 53 def self.time_like?(value) # Check for ActiveSupport's #acts_like_time? for their time-like objects # (like ActiveSupport::TimeWithZone). (value.respond_to?(:acts_like_time?) && value.acts_like_time?) || value.is_a?(Time) end