Sha256: 1b68f948c1ede460134f9e09fae5141a04b6a9359025ad2a9b19a327b14e4f9e

Contents?: true

Size: 409 Bytes

Versions: 8

Compression:

Stored size: 409 Bytes

Contents

module Gitrb

  class Diff
    attr_reader :from, :to, :patch, :deletions, :insertions

    def initialize(from, to, patch)
      @from = from
      @to = to
      @patch = patch
      @deletions = @insertions = 0
      @patch.split("\n").each do |line|
        if line[0..0] == '-'
          @deletions += 1
        elsif line[0..0] == '+'
          @insertions += 1
        end
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gitrb-0.0.8 lib/gitrb/diff.rb
gitrb-0.0.7 lib/gitrb/diff.rb
gitrb-0.0.6 lib/gitrb/diff.rb
gitrb-0.0.5 lib/gitrb/diff.rb
gitrb-0.0.4 lib/gitrb/diff.rb
gitrb-0.0.3 lib/gitrb/diff.rb
gitrb-0.0.2 lib/gitrb/diff.rb
gitrb-0.0.1 lib/gitrb/diff.rb