Class: RubyLens::GenerationPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/rubylens/generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(root:, lockfile: nil) ⇒ GenerationPipeline

Returns a new instance of GenerationPipeline.



7
8
9
10
# File 'lib/rubylens/generator.rb', line 7

def initialize(root:, lockfile: nil)
  @root = root
  @lockfile = lockfile
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/rubylens/generator.rb', line 12

def call
  manifest = Index::Manifest.build(root: @root, lockfile: @lockfile)
  snapshot = Index::RubydexAdapter.new(manifest).index
  model = ArtModelBuilder.new.build(snapshot)
  warning_counts = snapshot.fetch("warning_counts")
  warnings = manifest.warnings.dup
  warnings << "Rubydex reported #{warning_counts.fetch("index")} indexing error(s)." if warning_counts.fetch("index").positive?
  warnings << "Rubydex reported #{warning_counts.fetch("integrity")} integrity issue(s)." if warning_counts.fetch("integrity").positive?
  [model, warnings.freeze]
end