Class: SitePrism::Deprecator

Inherits:
Object
  • Object
show all
Defined in:
lib/site_prism/deprecator.rb

Overview

SitePrism::Deprecator

Class Method Summary collapse

Class Method Details

.deprecate(old, new = nil) ⇒ SitePrism.logger.warn(msg)

Tells the user that they are using old functionality, which needs removing in the next major version

Returns:



11
12
13
14
15
16
17
18
19
# File 'lib/site_prism/deprecator.rb', line 11

def deprecate(old, new = nil)
  if new
    warn("#{old} is being deprecated and should no longer be used. Use #{new} instead.")
  else
    warn("#{old} is being deprecated and should no longer be used.")
  end

  warn("#{old} will be removed in SitePrism v6. You have been warned!")
end