From e65847dd135dbfe762cd1020946990cca854344f 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..ea4b953 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 and will be removed + in solidus_support 1.0. Please use Spree.solidus_gem_version instead. + WARN + + Spree.solidus_gem_version end def reset_spree_preferences_deprecated?