サンプル
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. ruby 3 · linux…
sha256:19e4e8eba00e8dca2bf9eb099975a3c5176e2893cc7cebf61d6c84f5d3412a9b
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
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"