lib/wcc/contentful.rb in wcc-contentful-1.6.2 vs lib/wcc/contentful.rb in wcc-contentful-1.7.0

- old
+ new

@@ -38,21 +38,32 @@ # Gets the current configuration, after calling WCC::Contentful.configure attr_reader :configuration def types - ActiveSupport::Deprecation.warn('Use WCC::Contentful::Model.schema instead') + WCC::Contentful.deprecator.warn('Use WCC::Contentful::Model.schema instead') WCC::Contentful::Model.schema end # Gets all queryable locales. def locales configuration&.locale_fallbacks end def logger - ActiveSupport::Deprecation.warn('Use WCC::Contentful::Services.instance.logger instead') + WCC::Contentful.deprecator.warn('Use WCC::Contentful::Services.instance.logger instead') WCC::Contentful::Services.instance.logger + end + + def deprecator + @deprecator ||= + begin + next_major_version = WCC::Contentful::VERSION.split('.').first.next + ActiveSupport::Deprecation.new( + "#{next_major_version}.0", + 'wcc-contentful' + ) + end end end # Configures the WCC::Contentful gem to talk to a Contentful space. # This must be called first in your initializer, before #init! or accessing the