Class: RubyLens::GenerationPipeline
- Inherits:
-
Object
- Object
- RubyLens::GenerationPipeline
- Defined in:
- lib/rubylens/generator.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(root:, lockfile: nil) ⇒ GenerationPipeline
constructor
A new instance of GenerationPipeline.
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
#call ⇒ Object
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 |