Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

deprecate AS::Base64 methods without DeprecatedConstantProxy #4275

Merged
merged 1 commit into from

2 participants

@lest

No description provided.

@lest

@josevalim using DeprecatedConstantProxy cause tests to fail under 1.8.7

@josevalim josevalim merged commit c032ff6 into rails:3-2-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 13 deletions.
  1. +18 −13 activesupport/lib/active_support/base64.rb
View
31 activesupport/lib/active_support/base64.rb
@@ -30,18 +30,23 @@ def Base64.strict_encode64(value)
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
Something went wrong with that request. Please try again.