Class: Ace::Bundle::Organisms::PrBundleLoader
- Inherits:
-
Object
- Object
- Ace::Bundle::Organisms::PrBundleLoader
- Defined in:
- lib/ace/bundle/organisms/pr_bundle_loader.rb
Overview
Loads PR diff content into bundle
Responsible for:
-
Normalizing PR references (string, array, hash formats)
-
Fetching diffs via Ace::Git::Molecules::PrMetadataFetcher
-
Integrating results into bundle sections
-
Error handling and surfacing
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PrBundleLoader
constructor
A new instance of PrBundleLoader.
-
#process(bundle, pr_refs) ⇒ Boolean
Process PR references and add diffs to bundle.
Constructor Details
#initialize(options = {}) ⇒ PrBundleLoader
Returns a new instance of PrBundleLoader.
24 25 26 27 |
# File 'lib/ace/bundle/organisms/pr_bundle_loader.rb', line 24 def initialize( = {}) @timeout = [:timeout] || Ace::Git.network_timeout @debug = [:debug] || false end |
Instance Method Details
#process(bundle, pr_refs) ⇒ Boolean
Process PR references and add diffs to bundle
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ace/bundle/organisms/pr_bundle_loader.rb', line 34 def process(bundle, pr_refs) normalized = normalize_pr_refs(pr_refs) return false if normalized.empty? processed_diffs = fetch_all_diffs(bundle, normalized) successful_diffs = processed_diffs.select { |d| d[:success] } if successful_diffs.empty? surface_errors_to_content(bundle) return false end add_diffs_to_bundle(bundle, processed_diffs) true end |