crypt_keeper 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -105,7 +105,7 @@ There are two included encryptors.
105
105
  CryptKeeper has been tested against ActiveRecord 3.0, 3.1, 3.2 using ruby
106
106
  1.9.3 and jruby in 1.9 mode.
107
107
 
108
- ActiveRecord 4.0 is supported on the master branch.
108
+ ActiveRecord 4.0 is supported starting with v0.11.0.
109
109
 
110
110
  ## Installation
111
111
 
@@ -6,7 +6,7 @@ module CryptKeeper
6
6
  # Private: Sanitize an sql query and then execute it
7
7
  def escape_and_execute_sql(query)
8
8
  query = ::ActiveRecord::Base.send :sanitize_sql_array, query
9
- ::ActiveRecord::Base.connection.select_one(query)
9
+ ::ActiveRecord::Base.connection.execute(query).first
10
10
  end
11
11
  end
12
12
  end
@@ -23,7 +23,7 @@ module CryptKeeper
23
23
  # Returns an encrypted string
24
24
  def encrypt(value)
25
25
  Base64.encode64 escape_and_execute_sql(
26
- ["SELECT AES_ENCRYPT(?, ?) AS ciphertext", value, key])['ciphertext']
26
+ ["SELECT AES_ENCRYPT(?, ?)", value, key]).first
27
27
  end
28
28
 
29
29
  # Public: Decrypts a string
@@ -31,7 +31,7 @@ module CryptKeeper
31
31
  # Returns a plaintext string
32
32
  def decrypt(value)
33
33
  escape_and_execute_sql(
34
- ["SELECT AES_DECRYPT(?, ?) AS plaintext", Base64.decode64(value), key])['plaintext']
34
+ ["SELECT AES_DECRYPT(?, ?)", Base64.decode64(value), key]).first
35
35
  end
36
36
  end
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module CryptKeeper
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crypt_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -261,7 +261,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  segments:
263
263
  - 0
264
- hash: -875605086765827805
264
+ hash: 1020969970469435860
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  none: false
267
267
  requirements:
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  version: '0'
271
271
  segments:
272
272
  - 0
273
- hash: -875605086765827805
273
+ hash: 1020969970469435860
274
274
  requirements: []
275
275
  rubyforge_project:
276
276
  rubygems_version: 1.8.23