Sha256: 517e38b6461f09ae67513906ee68c0f4d9a93fdeea6b0d92c31b2eea54d7f2fb

Contents?: true

Size: 606 Bytes

Versions: 43

Compression:

Stored size: 606 Bytes

Contents

module Rugged
  class Blob
    class HashSignature
      WHITESPACE_DEFAULT  = 0
      WHITESPACE_IGNORE   = 1
      WHITESPACE_SMART    = 2
    end

    def hashsig(options = 0)
      @hashsig ||= HashSignature.new(self, options)
    end

    def similarity(other)
      other_sig = case other
      when HashSignature
        other
      when String
        HashSignature.new(other)
      when Blob
        other.hashsig
      else
        raise TypeError, "Expected a Rugged::Blob, String or Rugged::Blob::HashSignature"
      end

      HashSignature.compare(self.hashsig, other_sig)
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

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