Exception: Optimize::Codec::UnmatchedIBFVersion
- Inherits:
-
StandardError
- Object
- StandardError
- Optimize::Codec::UnmatchedIBFVersion
- Defined in:
- lib/optimize/codec.rb
Overview
Raised when the IBF header’s version stamp does not match the version this codec was written against. The CRuby loader makes the same check and raises “unmatched version file”; mirror that behavior here so a cross-version binary fails at decode with a clear error instead of producing nonsense.
Instance Attribute Summary collapse
-
#actual_major ⇒ Object
readonly
Returns the value of attribute actual_major.
-
#actual_minor ⇒ Object
readonly
Returns the value of attribute actual_minor.
-
#expected_major ⇒ Object
readonly
Returns the value of attribute expected_major.
-
#expected_minor ⇒ Object
readonly
Returns the value of attribute expected_minor.
Instance Method Summary collapse
-
#initialize(expected_major:, expected_minor:, actual_major:, actual_minor:) ⇒ UnmatchedIBFVersion
constructor
A new instance of UnmatchedIBFVersion.
Constructor Details
#initialize(expected_major:, expected_minor:, actual_major:, actual_minor:) ⇒ UnmatchedIBFVersion
Returns a new instance of UnmatchedIBFVersion.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/optimize/codec.rb', line 59 def initialize(expected_major:, expected_minor:, actual_major:, actual_minor:) @expected_major = expected_major @expected_minor = expected_minor @actual_major = actual_major @actual_minor = actual_minor super( "IBF version mismatch: codec targets Ruby #{expected_major}.#{expected_minor}, " \ "binary has #{actual_major}.#{actual_minor}. Recompile the source with the " \ "targeted Ruby, or port the codec to this Ruby version." ) end |
Instance Attribute Details
#actual_major ⇒ Object (readonly)
Returns the value of attribute actual_major.
57 58 59 |
# File 'lib/optimize/codec.rb', line 57 def actual_major @actual_major end |
#actual_minor ⇒ Object (readonly)
Returns the value of attribute actual_minor.
57 58 59 |
# File 'lib/optimize/codec.rb', line 57 def actual_minor @actual_minor end |
#expected_major ⇒ Object (readonly)
Returns the value of attribute expected_major.
57 58 59 |
# File 'lib/optimize/codec.rb', line 57 def expected_major @expected_major end |
#expected_minor ⇒ Object (readonly)
Returns the value of attribute expected_minor.
57 58 59 |
# File 'lib/optimize/codec.rb', line 57 def expected_minor @expected_minor end |