Class: Gollum::Git::Blob

Inherits:
Object
  • Object
show all
Defined in:
lib/grit_adapter/git_layer_grit.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(blob) ⇒ Blob

Returns a new instance of Blob.


42
43
44
# File 'lib/grit_adapter/git_layer_grit.rb', line 42

def initialize(blob)
  @blob = blob
end

Class Method Details

.create(repo, options) ⇒ Object


36
37
38
39
40
# File 'lib/grit_adapter/git_layer_grit.rb', line 36

def self.create(repo, options)
  #Grit::Blob.create(repo, :id => @sha, :name => name, :size => @size, :mode => @mode)
  blob = Grit::Blob.create(repo, options)
  self.new(blob)
end

Instance Method Details

#dataObject


58
59
60
# File 'lib/grit_adapter/git_layer_grit.rb', line 58

def data
  @blob.data
end

#idObject


46
47
48
# File 'lib/grit_adapter/git_layer_grit.rb', line 46

def id
  @blob.id
end

70
71
72
# File 'lib/grit_adapter/git_layer_grit.rb', line 70

def is_symlink
  @blob.is_symlink
end

#mime_typeObject


66
67
68
# File 'lib/grit_adapter/git_layer_grit.rb', line 66

def mime_type
  @blob.mime_type
end

#modeObject


50
51
52
# File 'lib/grit_adapter/git_layer_grit.rb', line 50

def mode
  @blob.mode
end

#nameObject


62
63
64
# File 'lib/grit_adapter/git_layer_grit.rb', line 62

def name
  @blob.name
end

#sizeObject


54
55
56
# File 'lib/grit_adapter/git_layer_grit.rb', line 54

def size
  @blob.size
end

74
75
76
# File 'lib/grit_adapter/git_layer_grit.rb', line 74

def symlink_target(base_path = nil)
  @blob.symlink_target(base_path)
end