Skip to content

Ruby gems

gem: <name>@<version> hashes the checksums of all platform gems of that version.

For npm, PyPI, crates, gems and Maven, an exact version binds that release. Anything else (a range, latest, a tag) binds the whole release list, so any new release runs the test again. Aval never picks a version from a range.

scope:
  resolve:
    - gem: rubocop@1.66.1   # exact
    - gem: rails@~>7.1      # floating
    - gem: bundler          # floating
  • Exact means a plain version (7.1.3, 7.2.0.beta1) with no operator. It binds every number RubyGems holds equal to it (7.1.3.0 too).
  • The name is a RubyGems name (a letter or digit, then letters, digits, ., _ or -). A spec with :, / or #, starting with . or ~/, or a name ending in .gem fails: use git or url, or pin.
  • gem install also reads a matching <name>-<version>.gem file in the current directory, which Aval does not see: run it where no such file lies.
  • Floating: every version, platform and checksum.
  • Registry $AVAL_RUBYGEMS_URL; credentials from ~/.netrc.

Pin instead for your application's gems: commit Gemfile.lock and add it to scope.dependencies. Resolve is for gem install tool in runner.command. Only the gem is bound, not the dependencies gem install picks.

scope.resolve never clears a scanner finding: a move changes the fingerprint, but the reference still blocks reuse. Pin it in place, or accept it with scope.allowMutable.