Class: Ryac::Pipeline::ConcatenatedSource

Inherits:
Data
  • Object
show all
Defined in:
lib/ryac/pipeline/data_types.rb,
sig/ryac/pipeline/data_types.rbs

Overview

Output of Stage 2 (Concatenator), input to Stage 3 (Minifier)

Stages that rewrite the text rebuild this with #with(content: ...): original_size and file_boundaries describe the collected input, not the current text, and #with is what keeps them traveling unchanged.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, file_boundaries: [], original_size: nil, stdlib_requires: [], rbs_files: {}, lazy_files: []) ⇒ ConcatenatedSource

A source built straight from a string (tests, sub-pipelines) has no file ancestry: everything but the content defaults away, and its original size is the content itself.

Parameters:

  • content: (String)
  • file_boundaries: (Array[FileBoundary]) (defaults to: [])
  • original_size: (Integer, nil) (defaults to: nil)
  • stdlib_requires: (Array[String]) (defaults to: [])
  • rbs_files: (Hash[String, String]) (defaults to: {})
  • lazy_files: (Array[String]) (defaults to: [])


102
103
104
105
106
107
# File 'lib/ryac/pipeline/data_types.rb', line 102

def initialize(content:, file_boundaries: [], original_size: nil, stdlib_requires: [], rbs_files: {}, lazy_files: []) # steep:ignore UndeclaredMethodDefinition
  super(content: content, file_boundaries: file_boundaries,
        original_size: original_size || content.bytesize,
        stdlib_requires: stdlib_requires, rbs_files: rbs_files,
        lazy_files: lazy_files)
end

Instance Attribute Details

#content ⇒ Object (readonly)

Returns the value of attribute content

Returns:

  • (Object) —

    the current value of content



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def content
  @content
end

#file_boundaries ⇒ Object (readonly)

Returns the value of attribute file_boundaries

Returns:

  • (Object) —

    the current value of file_boundaries



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def file_boundaries
  @file_boundaries
end

#lazy_files ⇒ Object (readonly)

Returns the value of attribute lazy_files

Returns:

  • (Object) —

    the current value of lazy_files



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def lazy_files
  @lazy_files
end

#original_size ⇒ Object (readonly)

Returns the value of attribute original_size

Returns:

  • (Object) —

    the current value of original_size



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def original_size
  @original_size
end

#rbs_files ⇒ Object (readonly)

Returns the value of attribute rbs_files

Returns:

  • (Object) —

    the current value of rbs_files



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def rbs_files
  @rbs_files
end

#stdlib_requires ⇒ Object (readonly)

Returns the value of attribute stdlib_requires

Returns:

  • (Object) —

    the current value of stdlib_requires



91
92
93
# File 'lib/ryac/pipeline/data_types.rb', line 91

def stdlib_requires
  @stdlib_requires
end

Class Method Details

.new ⇒ ConcatenatedSource

Parameters:

  • content: (String)
  • file_boundaries: (Array[FileBoundary])
  • original_size: (Integer, nil)
  • stdlib_requires: (Array[String])
  • rbs_files: (Hash[String, String])
  • lazy_files: (Array[String])

Returns:



46
# File 'sig/ryac/pipeline/data_types.rbs', line 46

def self.new: (content: String, ?file_boundaries: Array[FileBoundary], ?original_size: Integer?, ?stdlib_requires: Array[String], ?rbs_files: Hash[String, String], ?lazy_files: Array[String]) -> ConcatenatedSource

Instance Method Details

#with ⇒ ConcatenatedSource

Parameters:

  • content: (String)
  • file_boundaries: (Array[FileBoundary])
  • original_size: (Integer)
  • stdlib_requires: (Array[String])
  • rbs_files: (Hash[String, String])
  • lazy_files: (Array[String])

Returns:



48
# File 'sig/ryac/pipeline/data_types.rbs', line 48

def with: (?content: String, ?file_boundaries: Array[FileBoundary], ?original_size: Integer, ?stdlib_requires: Array[String], ?rbs_files: Hash[String, String], ?lazy_files: Array[String]) -> ConcatenatedSource