diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-13 14:02:18 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-13 14:02:18 -0300 |
commit | 8692db59af8f0dc468b588963622e61ff982a925 (patch) | |
tree | 968eddba8d75cb8f043bd77313866ba40e6801a8 /activesupport/CHANGELOG.md | |
parent | 1726a94900f86f19bcf1faf1afc06455607a8b59 (diff) | |
download | rails-8692db59af8f0dc468b588963622e61ff982a925.tar.gz rails-8692db59af8f0dc468b588963622e61ff982a925.tar.bz2 rails-8692db59af8f0dc468b588963622e61ff982a925.zip |
Copy-edit deprecation relared documentation [ci skip]
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r-- | activesupport/CHANGELOG.md | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 6dff6de83a..0b09f73383 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -5,30 +5,29 @@ You can choose which instance of the deprecator will be used. - deprecate :method_name, :deprecator => deprecator_instance + 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' + require 'active_support/deprecation' + require 'active_support/core_ext/module/deprecation' - class MyGem - def old_method - end - deprecate :old_method => :new_method, :deprecator => deprecator + class MyGem + def self.deprecator + ActiveSupport::Deprecation.new('2.0', 'MyGem') + end - def new_method - end + def old_method + end - def self.deprecator - ActiveSupport::Deprecation.new('2.0', 'MyGem') - end - end + def new_method + end - MyGem.new.old_method + deprecate :old_method => :new_method, :deprecator => deprecator + end - 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) + 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* |