Sha256: 248c06d83eb8ff527231a1bd9c4f7311c0a07c032a4b714fca8e1a1447dffedc

Contents?: true

Size: 652 Bytes

Versions: 45

Compression:

Stored size: 652 Bytes

Contents

module Rugged
  class Patch
    include Enumerable
    alias each each_hunk

    alias size hunk_count
    alias count hunk_count

    attr_accessor :owner
    alias diff owner

    def inspect
      "#<#{self.class.name}:#{object_id}>"
    end

    # Returns the number of additions in the patch.
    def additions
      stat[0]
    end

    # Returns the number of deletions in the patch.
    def deletions
      stat[1]
    end

    # Returns the number of total changes in the patch.
    def changes
      additions + deletions
    end

    # Returns an Array containing all hunks of the patch.
    def hunks
      each_hunk.to_a
    end
  end
end

Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
rugged-0.24.6.1 lib/rugged/patch.rb
rugged-0.24.5 lib/rugged/patch.rb
rugged-0.25.0b10 lib/rugged/patch.rb
rugged-0.25.0b9 lib/rugged/patch.rb
rugged-0.25.0b8 lib/rugged/patch.rb
rugged-0.25.0b7 lib/rugged/patch.rb
rugged-0.25.0b6 lib/rugged/patch.rb
rugged-0.25.0b5 lib/rugged/patch.rb
rugged-0.25.0b4 lib/rugged/patch.rb
rugged-0.25.0b3 lib/rugged/patch.rb
rugged-0.25.0b2 lib/rugged/patch.rb
rugged-0.25.0b1 lib/rugged/patch.rb
rugged-0.24.0 lib/rugged/patch.rb
rugged-0.24.0b14 lib/rugged/patch.rb
rugged-0.24.0b13 lib/rugged/patch.rb
rdavila-rugged-0.24.0b13 lib/rugged/patch.rb
rugged-0.24.0b12 lib/rugged/patch.rb
rugged-0.24.0b11 lib/rugged/patch.rb
rugged-0.24.0b9 lib/rugged/patch.rb
rugged-0.24.0b8 lib/rugged/patch.rb