Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
feat(ruby): Add RubyVendorArtifactCollector to collect vendor artifacts test(deno): Add golden tests for Deno analyzer with various fixtures test(deno): Create Deno module and package files for testing test(deno): Implement Deno lock and import map for dependency management test(deno): Add FFI and worker scripts for Deno testing feat(ruby): Set up Ruby workspace with Gemfile and dependencies feat(ruby): Add expected output for Ruby workspace tests feat(signals): Introduce CallgraphManifest model for signal processing
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
namespace StellaOps.Scanner.Analyzers.Lang.Ruby.Internal;
|
|
|
|
internal sealed class RubyLockData
|
|
{
|
|
private RubyLockData(IReadOnlyList<RubyLockEntry> entries, string bundledWith)
|
|
{
|
|
Entries = entries;
|
|
BundledWith = bundledWith ?? string.Empty;
|
|
}
|
|
|
|
public IReadOnlyList<RubyLockEntry> Entries { get; }
|
|
|
|
public string BundledWith { get; }
|
|
|
|
public bool IsEmpty => Entries.Count == 0;
|
|
|
|
public static ValueTask<RubyLockData> LoadAsync(LanguageAnalyzerContext context, CancellationToken cancellationToken)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(context);
|
|
return RubyLockCollector.LoadAsync(context, cancellationToken);
|
|
}
|
|
|
|
public static RubyLockData Create(IReadOnlyList<RubyLockEntry> entries, string bundledWith)
|
|
{
|
|
if (entries.Count == 0 && string.IsNullOrWhiteSpace(bundledWith))
|
|
{
|
|
return Empty;
|
|
}
|
|
|
|
return new RubyLockData(entries, bundledWith);
|
|
}
|
|
|
|
public static RubyLockData Empty { get; } = new(Array.Empty<RubyLockEntry>(), string.Empty);
|
|
}
|