1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Simplify OmniAuth version check by trying to load the gem with the necessary version

This commit is contained in:
Carlos Antonio da Silva 2021-01-22 09:16:58 -03:00
parent c43ae8cb47
commit 1d138dd40c

View file

@ -1,17 +1,14 @@
# frozen_string_literal: true
begin
gem "omniauth", ">= 1.0.0"
require "omniauth"
require "omniauth/version"
rescue LoadError
warn "Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile."
raise
end
if Gem::Version.new(OmniAuth::VERSION) < Gem::Version.new('1.0.0')
raise "You are using an old OmniAuth version, please ensure you have 1.0.0 version or later installed."
end
# Clean up the default path_prefix. It will be automatically set by Devise.
OmniAuth.config.path_prefix = nil