Class: Gitlab::Ci::Build::Artifacts::Adapters::RawStream
- Inherits:
-
Object
- Object
- Gitlab::Ci::Build::Artifacts::Adapters::RawStream
- Defined in:
- lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb
Constant Summary collapse
- InvalidStreamError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
- #each_blob {|stream.read, 'raw'| ... } ⇒ Object
-
#initialize(stream) ⇒ RawStream
constructor
A new instance of RawStream.
Constructor Details
#initialize(stream) ⇒ RawStream
Returns a new instance of RawStream.
13 14 15 16 17 |
# File 'lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb', line 13 def initialize(stream) raise InvalidStreamError, "Stream is required" unless stream @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
9 10 11 |
# File 'lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb', line 9 def stream @stream end |
Instance Method Details
#each_blob {|stream.read, 'raw'| ... } ⇒ Object
19 20 21 22 23 |
# File 'lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb', line 19 def each_blob stream.seek(0) yield(stream.read, 'raw') unless stream.eof? end |