Class: Travis::Artifacts::Artifact

Inherits:
Struct
  • Object
show all
Defined in:
lib/travis/artifacts/artifact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destinationObject

Returns the value of attribute destination

Returns:

  • (Object)

    the current value of destination



4
5
6
# File 'lib/travis/artifacts/artifact.rb', line 4

def destination
  @destination
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



4
5
6
# File 'lib/travis/artifacts/artifact.rb', line 4

def source
  @source
end

Instance Method Details

#content_typeObject



5
6
7
8
9
10
11
# File 'lib/travis/artifacts/artifact.rb', line 5

def content_type
  if MIME::Types.type_for(source).any?
    MIME::Types.type_for(source).first.content_type
  else
    'application/octet-stream'
  end
end

#readObject



13
14
15
# File 'lib/travis/artifacts/artifact.rb', line 13

def read
  File.read(source)
end