diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-01-03 16:33:08 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-01-03 16:37:20 +0300 |
commit | 1fc53df661aa89a0fbc15f07b0f28a38faf58894 (patch) | |
tree | c4a28cf64c11788a31ba175eadc1845e53bb88cf /activesupport/lib | |
parent | 2535898acfb5ebbb8933be48ce4dd536046cf272 (diff) | |
download | rails-1fc53df661aa89a0fbc15f07b0f28a38faf58894.tar.gz rails-1fc53df661aa89a0fbc15f07b0f28a38faf58894.tar.bz2 rails-1fc53df661aa89a0fbc15f07b0f28a38faf58894.zip |
deprecate AS::Base64 methods without DeprecatedConstantProxy
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/base64.rb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/base64.rb b/activesupport/lib/active_support/base64.rb index 8ffbb77108..bb4c955eea 100644 --- a/activesupport/lib/active_support/base64.rb +++ b/activesupport/lib/active_support/base64.rb @@ -30,18 +30,23 @@ unless Base64.respond_to?(:strict_encode64) end module ActiveSupport - Base64 = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('ActiveSupport::Base64', '::Base64') - - # *DEPRECATED*: Use +Base64.strict_encode64+ instead. - # - # Encodes the value as base64 without the newline breaks. This makes the base64 encoding readily usable as URL parameters - # or memcache keys without further processing. - # - # ActiveSupport::Base64.encode64s("Original unencoded string") - # # => "T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==" - def Base64.encode64s(value) - ActiveSupport::Deprecation.warn "encode64s " \ - "is deprecated. Use Base64.strict_encode64 instead", caller - encode64(value).gsub(/\n/, '') + module Base64 + def self.encode64(value) + ActiveSupport::Deprecation.warn "ActiveSupport::Base64.encode64 " \ + "is deprecated. Use Base64.encode64 instead", caller + ::Base64.encode64(value) + end + + def self.decode64(value) + ActiveSupport::Deprecation.warn "ActiveSupport::Base64.decode64 " \ + "is deprecated. Use Base64.decode64 instead", caller + ::Base64.encode64(value) + end + + def self.encode64s(value) + ActiveSupport::Deprecation.warn "ActiveSupport::Base64.encode64s " \ + "is deprecated. Use Base64.strict_encode64 instead", caller + ::Base64.strict_encode64(value) + end end end |