diff options
author | Piotr Niełacny <piotr.nielacny@gmail.com> | 2012-09-13 08:38:34 +0200 |
---|---|---|
committer | Piotr Niełacny <piotr.nielacny@gmail.com> | 2012-09-13 08:42:00 +0200 |
commit | 71993c6f9770b1350aa41fe8c68f1dd2c7800403 (patch) | |
tree | 515425716f332400ee5df8fb6515cc0c26ce6a0a /activesupport/CHANGELOG.md | |
parent | 2c690a0f5b36896da9b003d4e24159a27ebd7f71 (diff) | |
download | rails-71993c6f9770b1350aa41fe8c68f1dd2c7800403.tar.gz rails-71993c6f9770b1350aa41fe8c68f1dd2c7800403.tar.bz2 rails-71993c6f9770b1350aa41fe8c68f1dd2c7800403.zip |
Change ActiveSupport::Deprecation to class.
ActiveSupport::Deprecation is now a class rather than a module. You can
get instance of ActiveSupport::Deprecation calling #instance method.
ActiveSupport::Deprecation.instance
But when you need to get new object od ActiveSupport::Deprecation you
need to just call #new.
@instance = ActiveSupport::Deprecation.new
Since you can create a new object, you can change the version and the
name of the library where the deprecator concerned.
ActiveSupport::Deprecation.new('2.0', 'MyGem')
If you need use another deprecator instance you can select it in the
options of deprecate method.
deprecate :method, :deprecator => deprecator_instance
Documentation has been updated.
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r-- | activesupport/CHANGELOG.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 3914f4dc4c..6dff6de83a 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,5 +1,37 @@ ## Rails 4.0.0 (unreleased) ## +* ActiveSupport::Deprecation is now a class. It is possible to create an instance + of deprecator. Backwards compatibility has been preserved. + + You can choose which instance of the deprecator will be used. + + deprecate :method_name, :deprecator => deprecator_instance + + You can use ActiveSupport::Deprecation in your gem. + + require 'active_support/deprecation' + require 'active_support/core_ext/module/deprecation' + + class MyGem + def old_method + end + deprecate :old_method => :new_method, :deprecator => deprecator + + def new_method + end + + def self.deprecator + ActiveSupport::Deprecation.new('2.0', 'MyGem') + end + end + + MyGem.new.old_method + + DEPRECATION WARNING: old_method is deprecated and will be removed from MyGem 2.0 + (use new_method instead). (called from <main> at file.rb:18) + + *Piotr Niełacny & Robert Pankowecki* + * `ERB::Util.html_escape` encodes single quote as `#39`. Decimal form has better support in old browsers. *Kalys Osmonov* * `ActiveSupport::Callbacks`: deprecate monkey patch of object callbacks. |