Class: Ci::ArtifactBlob

Inherits:
Object
  • Object
show all
Includes:
BlobLike
Defined in:
app/models/ci/artifact_blob.rb

Constant Summary

Constants included from Gitlab::BlobHelper

Gitlab::BlobHelper::MEGABYTE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BlobLike

#binary_in_repo?, #load_all_data!, #name, #path, #truncated?

Methods included from Gitlab::BlobHelper

#_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

#initialize(entry) ⇒ ArtifactBlob

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

#entryObject (readonly)

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

#dataObject



24
25
26
# File 'app/models/ci/artifact_blob.rb', line 24

def data
  "Build artifact #{path}"
end

#external_link?(job) ⇒ Boolean

Returns:

  • (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_storageObject



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

#idObject



15
16
17
# File 'app/models/ci/artifact_blob.rb', line 15

def id
  Digest::SHA1.hexdigest(path)
end

#modeObject



28
29
30
# File 'app/models/ci/artifact_blob.rb', line 28

def mode
  entry.[:mode]
end

#sizeObject Also known as: external_size



19
20
21
# File 'app/models/ci/artifact_blob.rb', line 19

def size
  entry.[:size]
end