Rust now intentionally differs from or improves on current Python ScanCode Ruby handling in several concrete ways:
- resolves gemspec constants from required local Ruby files instead of leaving all external constants unresolved
- preserves Bundler
GemfileandGemfile.locksource metadata at parser level - merges extracted gem metadata layouts without duplicate package/dependency emission and assigns nested extracted files to the assembled gem package
- tags nested Ruby legal/readme/manifest files as
key_file, promotes package metadata from them, and computes a top-levellicense_clarity_score
The Python reference already handles some Bundler and gemspec data, but constant resolution, direct Gemfile provenance retention, extracted-gem deduplication, false-dependency protection, and nested key-file attribution remain incomplete.
- Gemspec parsing now loads required local Ruby files when resolving constant-backed gemspec fields.
- This resolves values like:
ProviderDSL::GemDescription::NAMEProviderDSL::GemDescription::VERSIONProviderDSL::GemDescription::AUTHORSProviderDSL::GemDescription::EMAILProviderDSL::GemDescription::PAGE
- The resolver stays intentionally narrow: it only looks at local required Ruby files adjacent to the gemspec, not arbitrary Ruby load paths.
- Bundler
GITandPATHmetadata is now preserved for:- git
remote revisionbranchref- source-type tagging
- PATH primary-package identity behavior
- git
- Direct
Gemfiledependencies now preserve declared manifest provenance in dependencyextra_datainstead of dropping it on parse. - Preserved metadata includes:
gitpathbranchreftag- per-dependency
source - inherited top-level
sourceURLs for plain registry dependencies
- The parser also records top-level Gemfile
sourcedeclarations in packageextra_data.sources, so manifest-only scans keep registry provenance even without a lockfile.
- Gemspec parsing ignores description text that merely mentions
add_dependency-like strings, so prose does not create fake dependencies.
metadata.gz-extractnow assembles with sibling extracted gemspec/Gemfile/Gemfile.lock layouts instead of standing alone.- Extracted gem dependency duplication is deduped during nested merge.
- Ruby package-root resource assignment now attaches nested files under the gem root — including subdirectory
LICENSEfiles and Ruby source files — to the assembled gem package.
- File-level classification now tags package-associated Ruby legal/readme/manifest files with:
is_legalis_manifestis_readmeis_top_levelis_key_file
- Nested files listed in Ruby package
file_referencesare treated as top-level for that package even when they are not at filesystem depth 1. - Package metadata is promoted from key files when missing, including:
copyrightholder
- Key-file license clues now stay in summary/tally outputs rather than mutating package declared-license provenance.
- Output now includes a top-level
summary.license_clarity_scoreblock derived from key files, plus the combined summary declared license expression and core top-level tallies.
- Better gemspec fidelity: narrow constant resolution recovers real package metadata without widening into arbitrary Ruby loading
- Stronger Gemfile-only provenance: manifest scans retain where dependencies came from even before a
Gemfile.lockis available - Cleaner extracted-gem results: nested metadata layouts merge without duplicate package noise
- Better attribution: nested legal and manifest files can contribute to package metadata and summary-level license clarity