Sha256: 81c90e135abd2cee279062ed1cfa9617447b80429492b2599ae5c66ae73a3367

Contents?: true

Size: 319 Bytes

Versions: 1

Compression:

Stored size: 319 Bytes

Contents

require 'diffy'

module MethodLog
  class MethodDiff
    def initialize(commit: nil, parent: nil)
      @commit, @parent = commit, parent
    end

    def to_s(mode = :text)
      Diffy::Diff.new(@commit.method_source, @parent.method_source).to_s(mode)
    end

    def empty?
      to_s.chomp.empty?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
method_log-0.0.3 lib/method_log/method_diff.rb