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
25
26
27
|
# File 'app/models/ci/artifact_blob.rb', line 25
def data
"Build artifact #{path}"
end
|
#external_link?(job) ⇒ Boolean
41
42
43
|
# File 'app/models/ci/artifact_blob.rb', line 41
def external_link?(job)
pages_url_builder(job.project).artifact_url_available?(entry, job)
end
|
#external_storage ⇒ Object
33
34
35
|
# File 'app/models/ci/artifact_blob.rb', line 33
def external_storage
:build_artifact
end
|
#external_url(job) ⇒ Object
37
38
39
|
# File 'app/models/ci/artifact_blob.rb', line 37
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
29
30
31
|
# File 'app/models/ci/artifact_blob.rb', line 29
def mode
entry.metadata[:mode]
end
|
#size ⇒ Object
Also known as:
external_size
19
20
21
22
|
# File 'app/models/ci/artifact_blob.rb', line 19
def size
entry.metadata.fetch(:size, 0)
end
|