Exception: Prism::CurrentVersionError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Prism::CurrentVersionError
- Defined in:
- lib/prism.rb,
sig/generated/prism.rbs
Overview
Raised when requested to parse as the currently running Ruby version but Prism has no support for it.
Instance Method Summary collapse
-
#initialize(version) ⇒ CurrentVersionError
constructor
Initialize a new exception for the given ruby version string.
Constructor Details
#initialize(version) ⇒ CurrentVersionError
Initialize a new exception for the given ruby version string.
: (String version) -> void
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/prism.rb', line 48 def initialize(version) = +"invalid version: Requested to parse as `version: 'current'`; " major, minor, = if version.match?(/\A\d+\.\d+.\d+\z/) version.split(".").map(&:to_i) end if major && minor && ((major < 3) || (major == 3 && minor < 3)) << " #{version} is below the minimum supported syntax." else << " #{version} is unknown. Please update the `prism` gem." end super() end |