Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor to activation

  • Loading branch information...
commit 32ec3bf4c03f0fff7658dba8567ef514dda167ad 1 parent b1486ed
Randy Secrist randysecrist authored
3  lib/ripple-encryption/encryption.rb → lib/ripple-encryption/activation.rb
View
@@ -2,14 +2,12 @@
require 'ripple'
module Ripple
-
module Encryption
# When mixed into a Ripple::Document class, this will encrypt the
# serialized form before it is stored in Riak. You must register
# a serializer that will perform the encryption.
# @see EncryptedSerializer
- module Encryption
extend ActiveSupport::Concern
@@is_activated = false
@@ -54,7 +52,6 @@ def self.activated
@@is_activated
end
- end
end
end
4 test/helper.rb
View
@@ -21,10 +21,10 @@
raise RuntimeError, "Could not connect to the Riak test node."
end
# define test Ripple Documents
-Ripple::Encryption::Encryption.activate ENV['ENCRYPTION']
+Ripple::Encryption.activate ENV['ENCRYPTION']
class TestDocument
include Ripple::Document
- include Ripple::Encryption::Encryption
+ include Ripple::Encryption
property :message, String
def self.bucket_name
2  test/test_unencrypted_document.rb
View
@@ -13,7 +13,7 @@ class TestMigrationV1ToV2 < MiniTest::Spec
should "write unencrypted document type when content-type is plain" do
document = TestDocument.new
document.message = 'here is some new data'
- Ripple::Encryption::Encryption.class_variable_set(:@@is_activated, false)
+ Ripple::Encryption.class_variable_set(:@@is_activated, false)
document.robject.content_type = 'application/json'
document.save
expected_v2_data = '{"message":"here is some new data","_type":"TestDocument"}'
Please sign in to comment.
Something went wrong with that request. Please try again.