Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenAPI] Explicitly load Prism #136

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions lib/rage/openapi/openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@
require "yaml"

if !defined?(Prism)
begin
require "prism"
rescue LoadError
fail <<~ERR

Rage::OpenAPI depends on Prism to build OpenAPI specifications. Add the following line to your Gemfile:
gem "prism"

ERR
end
end

if Gem::Version.create(Prism::VERSION) < Gem::Version.create("0.25.0")
fail <<~ERR

rage-rb depends on Prism to build OpenAPI specifications. Add the following line to your Gemfile:
gem "prism"
Rage::OpenAPI is only compatible with Prism >= 0.25.0. Detected Prism version: #{Prism::VERSION}. Add the following line to your Gemfile:
gem "prism", ">= 0.25.0"

ERR
end
Expand Down
Loading