Exception: Prism::CurrentVersionError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Prism::CurrentVersionError
- Defined in:
- lib/prism.rb
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.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/prism.rb', line 41 def initialize(version) = +"invalid version: Requested to parse as `version: 'current'`; " segments = if version.match?(/\A\d+\.\d+.\d+\z/) version.split(".").map(&:to_i) end if segments && ((segments[0] < 3) || (segments[0] == 3 && segments[1] < 3)) << " #{version} is below the minimum supported syntax." else << " #{version} is unknown. Please update the `prism` gem." end super() end |