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.
63 64 65 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 63 def initialize(blob) @blob = blob end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
51 52 53 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 51 def size @size end |
Class Method Details
.create(repo, options) ⇒ Object
Gollum::Git::Blob.create(repo, :id => @sha, :name => name, :size => @size, :mode => @mode)
54 55 56 57 58 59 60 61 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 54 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
80 81 82 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 80 def data @blob.data end |
#id ⇒ Object
72 73 74 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 72 def id @blob.id end |
#is_symlink ⇒ Object
92 93 94 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 92 def is_symlink @blob.is_symlink? end |
#mime_type ⇒ Object
88 89 90 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 88 def mime_type @blob.mime_type end |
#mode ⇒ Object
76 77 78 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 76 def mode @blob.mode end |
#name ⇒ Object
84 85 86 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 84 def name @blob.name end |
#set_size(size) ⇒ Object
Not required by gollum-lib. Should be private/protected?
68 69 70 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 68 def set_size(size) @size = size end |
#symlink_target(base_path = nil) ⇒ Object
96 97 98 99 100 101 |
# File 'lib/rjgit_adapter/git_layer_rjgit.rb', line 96 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 |