Class: RubyLens::GenerationPipeline
- Inherits:
-
Object
- Object
- RubyLens::GenerationPipeline
- Defined in:
- lib/rubylens/generator.rb
Instance Method Summary collapse
- #call(root:, lockfile: nil) ⇒ Object
-
#initialize(manifest_builder: Index::Manifest, adapter: Index::RubydexAdapter.new, model_builder: ArtModelBuilder.new) ⇒ GenerationPipeline
constructor
A new instance of GenerationPipeline.
Constructor Details
#initialize(manifest_builder: Index::Manifest, adapter: Index::RubydexAdapter.new, model_builder: ArtModelBuilder.new) ⇒ GenerationPipeline
Returns a new instance of GenerationPipeline.
7 8 9 10 11 |
# File 'lib/rubylens/generator.rb', line 7 def initialize(manifest_builder: Index::Manifest, adapter: Index::RubydexAdapter.new, model_builder: ArtModelBuilder.new) @manifest_builder = manifest_builder @adapter = adapter @model_builder = model_builder end |
Instance Method Details
#call(root:, lockfile: nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubylens/generator.rb', line 13 def call(root:, lockfile: nil) manifest = @manifest_builder.build(root: root, lockfile: lockfile) snapshot = @adapter.index(manifest) model = @model_builder.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 |