Class: Gollum::Git::Blob
- Inherits:
-
Object
- Object
- Gollum::Git::Blob
- Defined in:
- lib/rjgit_adapter/git_layer_rjgit.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Class Method Summary collapse
-
.create(repo, options) ⇒ Object
Gollum::Git::Blob.create(repo, :id => @sha, :name => name, :size => @size, :mode => @mode).
Instance Method Summary collapse
- #data ⇒ Object
- #id ⇒ Object
-
#initialize(blob) ⇒ Blob
constructor
A new instance of Blob.
- #is_symlink ⇒ Object
- #mime_type ⇒ Object
- #mode ⇒ Object
- #name ⇒ Object
-
#set_size(size) ⇒ Object
Not required by gollum-lib.
- #symlink_target(base_path = nil) ⇒ Object
Constructor Details
#initialize(blob) ⇒ Blob
Returns a new instance of Blob.
88 89 90 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 88 def initialize(blob) @blob = blob end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
76 77 78 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 76 def size @size end |
Class Method Details
.create(repo, options) ⇒ Object
Gollum::Git::Blob.create(repo, :id => @sha, :name => name, :size => @size, :mode => @mode)
79 80 81 82 83 84 85 86 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 79 def self.create(repo, ) blob = repo.find([:id], :blob) jblob = blob.jblob unless blob.nil? return nil if jblob.nil? blob = self.new(RJGit::Blob.new(repo.repo, [:mode], [:name], jblob)) blob.set_size([:size]) if [:size] return blob end |
Instance Method Details
#data ⇒ Object
105 106 107 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 105 def data @blob.data end |
#id ⇒ Object
97 98 99 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 97 def id @blob.id end |
#is_symlink ⇒ Object
117 118 119 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 117 def is_symlink @blob.is_symlink? end |
#mime_type ⇒ Object
113 114 115 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 113 def mime_type @blob.mime_type end |
#mode ⇒ Object
101 102 103 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 101 def mode @blob.mode end |
#name ⇒ Object
109 110 111 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 109 def name @blob.name end |
#set_size(size) ⇒ Object
Not required by gollum-lib. Should be private/protected?
93 94 95 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 93 def set_size(size) @size = size end |
#symlink_target(base_path = nil) ⇒ Object
121 122 123 124 125 126 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 121 def symlink_target(base_path = nil) target = @blob.data new_path = ::File.(::File.join('..', target), base_path) return new_path if ::File.file? new_path nil end |