Sha256: 836f026fc8b39cb657240479f82d9abefd013c51eac3624a13975ede0d3d8a13
Contents?: true
Size: 807 Bytes
Versions: 14
Compression:
Stored size: 807 Bytes
Contents
# -*- coding: utf-8; mode: ruby; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- vim:fenc=utf-8:filetype=ruby:et:sw=2:ts=2:sts=2 module GitCommitNotifier # Callback for Diff::LCS.traverse_balanced method. class DiffCallback # Gets collected tags. # @return [Array(Hash)] Collected tags. attr_reader :tags def initialize @tags = [] end # Adds diff match to {#tags}. def match(event) @tags << { :action => :match, :token => event.old_element } end # Adds discarded B side to {#tags}. def discard_b(event) @tags << { :action => :discard_b, :token => event.new_element } end # Adds discarded A side to {#tags}. def discard_a(event) @tags << { :action => :discard_a, :token => event.old_element } end end end
Version data entries
14 entries across 14 versions & 1 rubygems