mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
* Add concept of `Liquid::World` * Rename `World` to `Environment`
23 lines
469 B
Ruby
23 lines
469 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "set"
|
|
|
|
module Liquid
|
|
class Deprecations
|
|
class << self
|
|
attr_accessor :warned
|
|
|
|
Deprecations.warned = Set.new
|
|
|
|
def warn(name, alternative)
|
|
return if warned.include?(name)
|
|
|
|
warned << name
|
|
|
|
caller_location = caller_locations(2, 1).first
|
|
Warning.warn("[DEPRECATION] #{name} is deprecated. Use #{alternative} instead. Called from #{caller_location}\n")
|
|
end
|
|
end
|
|
end
|
|
end
|