Sha256: aacbdfc50495075927a96b622485f7e1053db0856ac2485aebbe8e94d4245b6d

Contents?: true

Size: 1.15 KB

Versions: 30

Compression:

Stored size: 1.15 KB

Contents

require 'active_support/string_inquirer'
require 'active_support/deprecation'

# Set up deprecation warnings:
Refinery.s3_backend = USE_S3_BACKEND if defined?(USE_S3_BACKEND) # map it before we deprecate it incase it's already in use
USE_S3_BACKEND = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
  cattr_accessor :warned
  self.warned = false

  def target(*args)
    Refinery.s3_backend
  end

  def replace(*args)
    warn(caller, :replace, *args)
  end

  def warn(callstack, called, args)
    unless self.warned
      puts (msg = "USE_S3_BACKEND is deprecated! Use Refinery.s3_backend instead")
      ActiveSupport::Deprecation.warn(msg, callstack)
      self.warned = true
    end
  end
end).new

REFINERY_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
  cattr_accessor :warned
  self.warned = false

  def target
    Refinery.root
  end

  def replace(*args)
    warn(caller, :replace, *args)
  end

  def warn(callstack, called, args)
    unless warned
      puts (msg = "REFINERY_ROOT is deprecated! Use Refinery.root instead")
      ActiveSupport::Deprecation.warn(msg, callstack)
      self.warned = true
    end
  end
end).new

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
refinerycms-0.9.7.15 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.14 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.13 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.11 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.10 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.9 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.8 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.7 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.6 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.5 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.4 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.3 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.2 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7.1 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.7 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.6.34 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.6.33 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.6.32 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.6.31 vendor/plugins/refinery/lib/refinery/deprecations.rb
refinerycms-0.9.6.30 vendor/plugins/refinery/lib/refinery/deprecations.rb