Froze rails gems
[depot.git] / vendor / rails / activesupport / lib / active_support / core_ext / base64 / encoding.rb
diff --git a/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb b/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb
new file mode 100644 (file)
index 0000000..a9656c1
--- /dev/null
@@ -0,0 +1,16 @@
+module ActiveSupport #:nodoc:
+  module CoreExtensions #:nodoc:
+    module Base64 #:nodoc:
+      module Encoding
+        # 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 encode64s(value)
+          encode64(value).gsub(/\n/, '')
+        end
+      end
+    end
+  end
+end