Class: Ci::ArtifactBlob
- Inherits:
-
Object
show all
- Includes:
- BlobLike
- Defined in:
- app/models/ci/artifact_blob.rb
Constant Summary
Gitlab::BlobHelper::MEGABYTE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from BlobLike
#binary_in_repo?, #load_all_data!, #name, #path, #truncated?
#_mime_type, #binary_in_repo?, #binary_mime_type?, #content_type, #empty?, #encoded_newlines_re, #encoding, #extname, #image?, #known_extension?, #large?, #lines, #mime_type, #ruby_encoding, #text_in_repo?, #viewable?
Constructor Details
Returns a new instance of ArtifactBlob.
9
10
11
|
# File 'app/models/ci/artifact_blob.rb', line 9
def initialize(entry)
@entry = entry
end
|
Instance Attribute Details
#entry ⇒ Object
Returns the value of attribute entry.
7
8
9
|
# File 'app/models/ci/artifact_blob.rb', line 7
def entry
@entry
end
|
Instance Method Details
#data ⇒ Object
24
25
26
|
# File 'app/models/ci/artifact_blob.rb', line 24
def data
"Build artifact #{path}"
end
|
#external_link?(job) ⇒ Boolean
40
41
42
|
# File 'app/models/ci/artifact_blob.rb', line 40
def external_link?(job)
pages_url_builder(job.project).artifact_url_available?(entry, job)
end
|
#external_storage ⇒ Object
32
33
34
|
# File 'app/models/ci/artifact_blob.rb', line 32
def external_storage
:build_artifact
end
|
#external_url(job) ⇒ Object
36
37
38
|
# File 'app/models/ci/artifact_blob.rb', line 36
def external_url(job)
pages_url_builder(job.project).artifact_url(entry, job)
end
|
#id ⇒ Object
15
16
17
|
# File 'app/models/ci/artifact_blob.rb', line 15
def id
Digest::SHA1.hexdigest(path)
end
|
#mode ⇒ Object
28
29
30
|
# File 'app/models/ci/artifact_blob.rb', line 28
def mode
entry.metadata[:mode]
end
|
#size ⇒ Object
Also known as:
external_size
19
20
21
|
# File 'app/models/ci/artifact_blob.rb', line 19
def size
entry.metadata[:size]
end
|