Module: SuperDiff

Defined in:
lib/super_diff/csi.rb,
lib/super_diff.rb,
lib/super_diff/rspec.rb,
lib/super_diff/errors.rb,
lib/super_diff/differs.rb,
lib/super_diff/helpers.rb,
lib/super_diff/version.rb,
lib/super_diff/csi/color.rb,
lib/super_diff/operations.rb,
lib/super_diff/gem_version.rb,
lib/super_diff/csi/document.rb,
lib/super_diff/differs/base.rb,
lib/super_diff/differs/hash.rb,
lib/super_diff/differs/main.rb,
lib/super_diff/rspec/differ.rb,
lib/super_diff/active_record.rb,
lib/super_diff/configuration.rb,
lib/super_diff/differs/array.rb,
lib/super_diff/differs/empty.rb,
lib/super_diff/rspec/differs.rb,
lib/super_diff/active_support.rb,
lib/super_diff/diff_formatters.rb,
lib/super_diff/operation_trees.rb,
lib/super_diff/recursion_guard.rb,
lib/super_diff/differs/defaults.rb,
lib/super_diff/csi/bold_sequence.rb,
lib/super_diff/differs/time_like.rb,
lib/super_diff/equality_matchers.rb,
lib/super_diff/object_inspection.rb,
lib/super_diff/csi/four_bit_color.rb,
lib/super_diff/csi/reset_sequence.rb,
lib/super_diff/csi/eight_bit_color.rb,
lib/super_diff/diff_formatters/base.rb,
lib/super_diff/diff_formatters/hash.rb,
lib/super_diff/diff_formatters/main.rb,
lib/super_diff/operation_trees/base.rb,
lib/super_diff/operation_trees/hash.rb,
lib/super_diff/operation_trees/main.rb,
lib/super_diff/active_record/differs.rb,
lib/super_diff/diff_formatters/array.rb,
lib/super_diff/differs/custom_object.rb,
lib/super_diff/implementation_checks.rb,
lib/super_diff/operation_trees/array.rb,
lib/super_diff/active_support/differs.rb,
lib/super_diff/csi/colorized_document.rb,
lib/super_diff/differs/default_object.rb,
lib/super_diff/equality_matchers/base.rb,
lib/super_diff/equality_matchers/hash.rb,
lib/super_diff/equality_matchers/main.rb,
lib/super_diff/equality_matchers/array.rb,
lib/super_diff/object_inspection/nodes.rb,
lib/super_diff/operation_tree_builders.rb,
lib/super_diff/rspec/augmented_matcher.rb,
lib/super_diff/rspec/object_inspection.rb,
lib/super_diff/csi/color_sequence_block.rb,
lib/super_diff/csi/uncolorized_document.rb,
lib/super_diff/diff_formatters/defaults.rb,
lib/super_diff/differs/multiline_string.rb,
lib/super_diff/operation_trees/defaults.rb,
lib/super_diff/csi/twenty_four_bit_color.rb,
lib/super_diff/equality_matchers/default.rb,
lib/super_diff/diff_formatters/collection.rb,
lib/super_diff/equality_matchers/defaults.rb,
lib/super_diff/operations/unary_operation.rb,
lib/super_diff/equality_matchers/primitive.rb,
lib/super_diff/operations/binary_operation.rb,
lib/super_diff/rspec/matcher_text_builders.rb,
lib/super_diff/rspec/matcher_text_template.rb,
lib/super_diff/object_inspection/inspectors.rb,
lib/super_diff/object_inspection/nodes/base.rb,
lib/super_diff/object_inspection/nodes/text.rb,
lib/super_diff/operation_tree_builders/base.rb,
lib/super_diff/operation_tree_builders/hash.rb,
lib/super_diff/operation_tree_builders/main.rb,
lib/super_diff/rspec/differs/hash_including.rb,
lib/super_diff/active_record/diff_formatters.rb,
lib/super_diff/active_record/operation_trees.rb,
lib/super_diff/colorized_document_extensions.rb,
lib/super_diff/diff_formatters/custom_object.rb,
lib/super_diff/object_inspection/nodes/break.rb,
lib/super_diff/operation_tree_builders/array.rb,
lib/super_diff/operation_trees/custom_object.rb,
lib/super_diff/rspec/operation_tree_builders.rb,
lib/super_diff/active_support/diff_formatters.rb,
lib/super_diff/active_support/operation_trees.rb,
lib/super_diff/diff_formatters/default_object.rb,
lib/super_diff/operation_trees/default_object.rb,
lib/super_diff/active_record/object_inspection.rb,
lib/super_diff/object_inspection/nodes/nesting.rb,
lib/super_diff/active_support/object_inspection.rb,
lib/super_diff/diff_formatters/multiline_string.rb,
lib/super_diff/errors/no_differ_available_error.rb,
lib/super_diff/operation_tree_builders/defaults.rb,
lib/super_diff/operation_trees/multiline_string.rb,
lib/super_diff/rspec/matcher_text_builders/base.rb,
lib/super_diff/object_inspection/inspection_tree.rb,
lib/super_diff/object_inspection/inspectors/base.rb,
lib/super_diff/object_inspection/inspectors/hash.rb,
lib/super_diff/object_inspection/inspectors/main.rb,
lib/super_diff/operation_tree_builders/time_like.rb,
lib/super_diff/rspec/matcher_text_builders/match.rb,
lib/super_diff/equality_matchers/multiline_string.rb,
lib/super_diff/object_inspection/inspectors/array.rb,
lib/super_diff/object_inspection/nodes/inspection.rb,
lib/super_diff/object_inspection/nodes/when_empty.rb,
lib/super_diff/rspec/differs/collection_including.rb,
lib/super_diff/rspec/object_inspection/inspectors.rb,
lib/super_diff/equality_matchers/singleline_string.rb,
lib/super_diff/object_inspection/inspectors/string.rb,
lib/super_diff/active_record/operation_tree_builders.rb,
lib/super_diff/object_inspection/inspectors/defaults.rb,
lib/super_diff/operation_tree_builders/custom_object.rb,
lib/super_diff/active_support/operation_tree_builders.rb,
lib/super_diff/object_inspection/inspectors/primitive.rb,
lib/super_diff/object_inspection/inspectors/time_like.rb,
lib/super_diff/object_inspection/nodes/when_multiline.rb,
lib/super_diff/object_inspection/nodes/when_non_empty.rb,
lib/super_diff/operation_tree_builders/default_object.rb,
lib/super_diff/rspec/differs/object_having_attributes.rb,
lib/super_diff/rspec/matcher_text_builders/respond_to.rb,
lib/super_diff/object_inspection/nodes/when_singleline.rb,
lib/super_diff/rspec/matcher_text_builders/raise_error.rb,
lib/super_diff/errors/no_diff_formatter_available_error.rb,
lib/super_diff/operation_tree_builders/multiline_string.rb,
lib/super_diff/rspec/matcher_text_builders/be_predicate.rb,
lib/super_diff/active_record/object_inspection/inspectors.rb,
lib/super_diff/object_inspection/inspectors/custom_object.rb,
lib/super_diff/rspec/matcher_text_builders/have_predicate.rb,
lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb,
lib/super_diff/active_support/object_inspection/inspectors.rb,
lib/super_diff/object_inspection/inspectors/default_object.rb,
lib/super_diff/rspec/differs/collection_containing_exactly.rb,
lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb,
lib/super_diff/active_record/differs/active_record_relation.rb,
lib/super_diff/rspec/object_inspection/inspectors/primitive.rb,
lib/super_diff/rspec/operation_tree_builders/hash_including.rb,
lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb,
lib/super_diff/errors/no_operational_sequencer_available_error.rb,
lib/super_diff/rspec/object_inspection/inspectors/value_within.rb,
lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb,
lib/super_diff/rspec/operation_tree_builders/collection_including.rb,
lib/super_diff/active_support/differs/hash_with_indifferent_access.rb,
lib/super_diff/active_record/diff_formatters/active_record_relation.rb,
lib/super_diff/active_record/operation_trees/active_record_relation.rb,
lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb,
lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb,
lib/super_diff/active_record/operation_tree_builders/active_record_model.rb,
lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb,
lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb,
lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb,
lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb,
lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb,
lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb,
lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb,
lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb,
lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb,
lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb

Overview

Defined Under Namespace

Modules: ActiveRecord, ActiveSupport, ColorizedDocumentExtensions, Csi, DiffFormatters, Differs, EqualityMatchers, Errors, Helpers, ImplementationChecks, ObjectInspection, OperationTreeBuilders, OperationTrees, Operations, RSpec, RecursionGuard Classes: Configuration, GemVersion

Constant Summary collapse

VERSION =
"0.6.1".freeze

Class Method Summary collapse

Class Method Details

.configurationObject


29
30
31
# File 'lib/super_diff.rb', line 29

def self.configuration
  @_configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:


25
26
27
# File 'lib/super_diff.rb', line 25

def self.configure
  yield configuration
end

.time_like?(value) ⇒ Boolean

Returns:

  • (Boolean)

33
34
35
36
37
38
# File 'lib/super_diff.rb', line 33

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