Sha256: be0e2c01907d26e30f61d08f107369029fd4100f19f603c34f0e1ae105c3d99a

Contents?: true

Size: 606 Bytes

Versions: 17

Compression:

Stored size: 606 Bytes

Contents

require 'linguist'
require 'elasticsearch/git/encoder_helper'

module Elasticsearch
  module Git
    class LiteBlob
      include Linguist::BlobHelper
      include Elasticsearch::Git::EncoderHelper

      attr_accessor :id, :name, :path, :data, :size, :mode, :commit_id

      def initialize(repo, raw_blob_hash)
        @id   = raw_blob_hash[:oid]

        blob  = repo.lookup(@id)

        @mode = raw_blob_hash[:mode].to_s(8)
        @size = blob.size
        @path = encode!(raw_blob_hash[:path])
        @name = @path.split('/').last
        @data = encode!(blob.content)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
gitlab-elasticsearch-git-1.1.0 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-1.0.2 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-1.0.1 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-1.0.0 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.17 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.16 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.15 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.14 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.13 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.12 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.11 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.10 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.9 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.8 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.7 lib/elasticsearch/git/lite_blob.rb
gitlab-elasticsearch-git-0.0.6 lib/elasticsearch/git/lite_blob.rb
elasticsearch-git-0.0.5 lib/elasticsearch/git/lite_blob.rb