Sha256: f09949e7bf4acf534acd43da5faaf6e5c0b00dadb4f2def6fab5480a3f0bc201
Contents?: true
Size: 752 Bytes
Versions: 8
Compression:
Stored size: 752 Bytes
Contents
module Rpush module Deprecatable def self.included(base) base.extend ClassMethods end module ClassMethods def deprecated(method_name, version, msg = nil) method_name_as_var = method_name.to_s.tr('=', '_setter_') instance_eval do alias_method "#{method_name_as_var}_without_warning", method_name end warning = "#{method_name} is deprecated and will be removed from Rpush #{version}." warning << " #{msg}" if msg class_eval(<<-RUBY, __FILE__, __LINE__) def #{method_name}(*args, &blk) Rpush::Deprecation.warn(#{warning.inspect}) #{method_name_as_var}_without_warning(*args, &blk) end RUBY end end end end
Version data entries
8 entries across 8 versions & 1 rubygems