Exception: Prism::CurrentVersionError
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
ArgumentError
|
|
|
Instance Chain:
self,
ArgumentError
|
|
| Inherits: |
ArgumentError
|
| Defined in: | lib/prism.rb |
Overview
Raised when requested to parse as the currently running Ruby version but ::Prism has no support for it.
Class Method Summary
-
.new(version) ⇒ CurrentVersionError
constructor
Initialize a new exception for the given ruby version string.
Constructor Details
.new(version) ⇒ CurrentVersionError
Initialize a new exception for the given ruby version string.
# File 'lib/prism.rb', line 44
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