From 2b7a09a813f510d0495df2252418cb4c0c95309f Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Wed, 18 Dec 2019 18:16:30 +0100 Subject: [PATCH] Deprecate SolidusSupport.solidus_gem_version --- lib/solidus_support.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/solidus_support.rb b/lib/solidus_support.rb index e26f876..3328a43 100644 --- a/lib/solidus_support.rb +++ b/lib/solidus_support.rb @@ -8,15 +8,12 @@ module SolidusSupport class << self def solidus_gem_version - if Spree.respond_to?(:solidus_gem_version) - Spree.solidus_gem_version - elsif Spree.respond_to?(:gem_version) - # 1.1 doesn't have solidus_gem_version - Gem::Version.new(Spree.solidus_version) - else - # 1.0 doesn't have gem_version - Gem::Specification.detect { |x| x.name == 'solidus_core' }.version - end + ActiveSupport::Deprecation.warn <<-WARN.squish, caller + SolidusSupport.solidus_gem_version is deprecated. Please use + Spree.solidus_gem_version instead. + WARN + + Spree.solidus_gem_version end def reset_spree_preferences_deprecated?