Пример
activesupport 8.1.3.1: ActiveSupport.gem_version returns a Gem::Version instance representing the ActiveSupport version string
Проверенный пример — gem activesupport 8.1.3.1: ActiveSupport.gem_version returns a Gem::Version instance representing the ActiveSupport version string.…
sha256:19e4e8eba00e8dca2bf9eb099975a3c5176e2893cc7cebf61d6c84f5d3412a9b
Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла.
Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди.
MIT-0
Свидетельства выполнения
Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.
- Основа свидетельства
- Подписанный контракт пройден
- Квитанции проверки
- 2
- Ключи подписи, собравшие его
- 2
Заявленная среда
ruby linux x64 ruby ruby bundler
Среды запусков проверки
| Окружение | Контракт | Этапы | Запуск |
|---|---|---|---|
| ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-17 |
| ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-18 |
Кейс
HOW- Цель
- ActiveSupport.gem_version returns a Gem::Version instance representing the ActiveSupport version string
- Пакеты
- Символы
-
- ActiveSupport.gem_version
- Окружение
- ruby
- Создан
- 2026-08-17T21:34:31Z
Контракт
- ActiveSupport.gem_version returns a Gem::Version instance with version string 8.1.3.1 that supports semantic comparisons and segments decomposition.
- ActiveSupport.gem_version can be loaded independently via active_support/gem_version without requiring all of ActiveSupport.
- ActiveSupport.version returns the same Gem::Version instance when active_support/version is loaded.
Файлы
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Исходный код
source "https://rubygems.org"
gem "activesupport", "8.1.3.1"
GEM
remote: https://rubygems.org/
specs:
activesupport (8.1.3.1)
base64
benchmark
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
drb (2.2.1)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
logger (1.7.0)
minitest (5.25.4)
mutex_m (0.3.0)
securerandom (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (1.0.3)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
activesupport (= 8.1.3.1)
BUNDLED WITH
2.6.2
# ActiveSupport Version Metadata Introspection
`search_known_solution` answered `NO_SAFE_MATCH` for `ActiveSupport.gem_version` on version `8.1.3.1`.
## Pinned Release
- `activesupport` `8.1.3.1` pinned in `Gemfile` and `Gemfile.lock`.
## Observed Behavior
- `ActiveSupport.gem_version` returns an instance of `Gem::Version` initialized from `ActiveSupport::VERSION::STRING` (`"8.1.3.1"`).
- Calling `ActiveSupport.gem_version` returns a `Gem::Version` object (not a primitive `String`), enabling direct usage with `Gem::Requirement` and semantic comparison operators (`<`, `<=`, `==`, `>=`, `>`).
- Calling `.segments` on the returned version decomposes the release into `[8, 1, 3, 1]`.
- Calling `.prerelease?` on `8.1.3.1` returns `false` because the 4th component is purely numerical rather than a pre-release tag (such as `rc` or `beta`).
- `ActiveSupport.gem_version` can be loaded in isolation by requiring `active_support/gem_version` without needing to require the full `active_support` gem bundle.
- Requiring `active_support/version` defines `ActiveSupport.version`, which returns the exact same `Gem::Version` instance as `ActiveSupport.gem_version`.
{"case":{"caseId":"case:sha256:bcc2e38b9e0a7622288541c6ad021cc75799a23669d3b3dddad9f08b36e7403d","contract":["ActiveSupport.gem_version returns a Gem::Version instance with version string 8.1.3.1 that supports semantic comparisons and segments decomposition.","ActiveSupport.gem_version can be loaded independently via active_support/gem_version without requiring all of ActiveSupport.","ActiveSupport.version returns the same Gem::Version instance when active_support/version is loaded."],"goal":"ActiveSupport.gem_version returns a Gem::Version instance representing the ActiveSupport version string","kind":"HOW","packages":["pkg:gem/activesupport@8.1.3.1"],"schemaVersion":1,"symbols":["ActiveSupport.gem_version"]},"contractCommand":["ruby","test/contract.rb"],"environment":{"arch":"x64","ecosystem":"gem","executionContext":"ruby","language":"ruby","os":"linux","packageManager":"bundler","runtime":"ruby","schemaVersion":1},"license":"MIT-0","packages":["pkg:gem/activesupport@8.1.3.1"],"schemaVersion":1,"symbols":["ActiveSupport.gem_version"],"verifierAdapter":"rubygems@1"}
# frozen_string_literal: true
require "active_support/gem_version"
# ActiveSupport.gem_version returns a Gem::Version object
version = ActiveSupport.gem_version
raise "Expected Gem::Version instance, got #{version.class}" unless version.is_a?(Gem::Version)
raise "Expected version string '8.1.3.1', got '#{version.to_s}'" unless version.to_s == "8.1.3.1"
raise "Expected version '8.1.3.1', got '#{version.version}'" unless version.version == "8.1.3.1"
# Segments breakdown into [8, 1, 3, 1]
raise "Expected segments [8, 1, 3, 1], got #{version.segments.inspect}" unless version.segments == [8, 1, 3, 1]
# Prerelease check returns false for standard 4-digit patch release
raise "Expected prerelease? to be false" if version.prerelease?
# Version comparison semantics with Gem::Version
raise "Expected gem_version >= 8.1.0" unless version >= Gem::Version.new("8.1.0")
raise "Expected gem_version == 8.1.3.1" unless version == Gem::Version.new("8.1.3.1")
raise "Expected gem_version > 8.1.3" unless version > Gem::Version.new("8.1.3")
raise "Expected gem_version < 8.2.0" unless version < Gem::Version.new("8.2.0")
# Compatibility with Gem::Requirement
requirement = Gem::Requirement.new("~> 8.1.3")
raise "Expected requirement '~> 8.1.3' to be satisfied" unless requirement.satisfied_by?(version)
# VERSION module constants match individual segments
raise "Expected MAJOR == 8" unless ActiveSupport::VERSION::MAJOR == 8
raise "Expected MINOR == 1" unless ActiveSupport::VERSION::MINOR == 1
raise "Expected TINY == 3" unless ActiveSupport::VERSION::TINY == 3
raise "Expected STRING == '8.1.3.1'" unless ActiveSupport::VERSION::STRING == "8.1.3.1"
# Requiring active_support/version provides ActiveSupport.version as an alias
require "active_support/version"
raise "Expected ActiveSupport.version == ActiveSupport.gem_version" unless ActiveSupport.version == ActiveSupport.gem_version
puts "Contract passed: ActiveSupport.gem_version correctly verified on 8.1.3.1"