From 3f3c803a46820705a7e1c08511eeaa346c11c48c Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 22 Dec 2014 17:08:52 -0500 Subject: [PATCH] update to 4.2 --- .travis.yml | 6 + Appraisals | 5 + README.md | 2 +- crypt_keeper.gemspec | 4 +- gemfiles/activerecord_3_1.gemfile.lock | 4 +- gemfiles/activerecord_3_2.gemfile.lock | 4 +- gemfiles/activerecord_4_0.gemfile.lock | 4 +- gemfiles/activerecord_4_1.gemfile.lock | 4 +- gemfiles/activerecord_4_2.gemfile | 8 ++ gemfiles/activerecord_4_2.gemfile.lock | 123 +++++++++++++++++++++ lib/crypt_keeper/provider/mysql_aes_new.rb | 2 +- 11 files changed, 154 insertions(+), 12 deletions(-) create mode 100644 gemfiles/activerecord_4_2.gemfile create mode 100644 gemfiles/activerecord_4_2.gemfile.lock diff --git a/.travis.yml b/.travis.yml index 6756e04..63de784 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,12 @@ gemfile: - gemfiles/activerecord_3_2.gemfile - gemfiles/activerecord_4_0.gemfile - gemfiles/activerecord_4_1.gemfile + - gemfiles/activerecord_4_2.gemfile + +matrix: + include: + - rvm: 2.2.0 + gemfile: gemfiles/activerecord_4_2.gemfile addons: postgresql: 9.3 diff --git a/Appraisals b/Appraisals index 37e4de7..80ebd4e 100644 --- a/Appraisals +++ b/Appraisals @@ -17,3 +17,8 @@ appraise "activerecord_4_1" do gem 'activerecord', '~> 4.1.0' gem 'activesupport', '~> 4.1.0' end + +appraise "activerecord_4_2" do + gem 'activerecord', '~> 4.2.0' + gem 'activesupport', '~> 4.2.0' +end diff --git a/README.md b/README.md index 2d9f890..17b90d2 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ end ## Requirements -CryptKeeper has been tested against ActiveRecord 3.1, 3.2, 4.0, 4.1 using ruby +CryptKeeper has been tested against ActiveRecord 3.1, 3.2, 4.0, 4.1, 4.2 using ruby 1.9.3, 2.0.0 and 2.1.1 ActiveRecord 4.0 is supported starting with v0.11.0. diff --git a/crypt_keeper.gemspec b/crypt_keeper.gemspec index 17e2f54..ace666d 100644 --- a/crypt_keeper.gemspec +++ b/crypt_keeper.gemspec @@ -16,8 +16,8 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.version = CryptKeeper::VERSION - gem.add_runtime_dependency 'activerecord', '>= 3.1', '< 4.2' - gem.add_runtime_dependency 'activesupport', '>= 3.1', '< 4.2' + gem.add_runtime_dependency 'activerecord', '>= 3.1', '<= 4.2' + gem.add_runtime_dependency 'activesupport', '>= 3.1', '<= 4.2' gem.add_runtime_dependency 'aes', '~> 0.5.0' gem.add_runtime_dependency 'armor', '~> 0.0.2' diff --git a/gemfiles/activerecord_3_1.gemfile.lock b/gemfiles/activerecord_3_1.gemfile.lock index 7bfe57a..fef66f2 100644 --- a/gemfiles/activerecord_3_1.gemfile.lock +++ b/gemfiles/activerecord_3_1.gemfile.lock @@ -2,8 +2,8 @@ PATH remote: ../ specs: crypt_keeper (0.18.4) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) + activerecord (>= 3.1, <= 4.2) + activesupport (>= 3.1, <= 4.2) aes (~> 0.5.0) armor (~> 0.0.2) diff --git a/gemfiles/activerecord_3_2.gemfile.lock b/gemfiles/activerecord_3_2.gemfile.lock index a110491..24678cf 100644 --- a/gemfiles/activerecord_3_2.gemfile.lock +++ b/gemfiles/activerecord_3_2.gemfile.lock @@ -2,8 +2,8 @@ PATH remote: ../ specs: crypt_keeper (0.18.4) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) + activerecord (>= 3.1, <= 4.2) + activesupport (>= 3.1, <= 4.2) aes (~> 0.5.0) armor (~> 0.0.2) diff --git a/gemfiles/activerecord_4_0.gemfile.lock b/gemfiles/activerecord_4_0.gemfile.lock index 6629555..9389846 100644 --- a/gemfiles/activerecord_4_0.gemfile.lock +++ b/gemfiles/activerecord_4_0.gemfile.lock @@ -2,8 +2,8 @@ PATH remote: ../ specs: crypt_keeper (0.18.4) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) + activerecord (>= 3.1, <= 4.2) + activesupport (>= 3.1, <= 4.2) aes (~> 0.5.0) armor (~> 0.0.2) diff --git a/gemfiles/activerecord_4_1.gemfile.lock b/gemfiles/activerecord_4_1.gemfile.lock index d92686e..87c0008 100644 --- a/gemfiles/activerecord_4_1.gemfile.lock +++ b/gemfiles/activerecord_4_1.gemfile.lock @@ -2,8 +2,8 @@ PATH remote: ../ specs: crypt_keeper (0.18.4) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) + activerecord (>= 3.1, <= 4.2) + activesupport (>= 3.1, <= 4.2) aes (~> 0.5.0) armor (~> 0.0.2) diff --git a/gemfiles/activerecord_4_2.gemfile b/gemfiles/activerecord_4_2.gemfile new file mode 100644 index 0000000..5f5ecfd --- /dev/null +++ b/gemfiles/activerecord_4_2.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 4.2.0" +gem "activesupport", "~> 4.2.0" + +gemspec :path => "../" diff --git a/gemfiles/activerecord_4_2.gemfile.lock b/gemfiles/activerecord_4_2.gemfile.lock new file mode 100644 index 0000000..6f1cb7e --- /dev/null +++ b/gemfiles/activerecord_4_2.gemfile.lock @@ -0,0 +1,123 @@ +PATH + remote: ../ + specs: + crypt_keeper (0.18.4) + activerecord (>= 3.1, <= 4.2) + activesupport (>= 3.1, <= 4.2) + aes (~> 0.5.0) + armor (~> 0.0.2) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (4.2.0) + activesupport (= 4.2.0) + builder (~> 3.1) + activerecord (4.2.0) + activemodel (= 4.2.0) + activesupport (= 4.2.0) + arel (~> 6.0) + activesupport (4.2.0) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + aes (0.5.0) + appraisal (1.0.2) + bundler + rake + thor (>= 0.14.0) + arel (6.0.0) + armor (0.0.3) + builder (3.2.2) + celluloid (0.16.0) + timers (~> 4.0.0) + coderay (1.1.0) + coveralls (0.7.1) + multi_json (~> 1.3) + rest-client + simplecov (>= 0.7) + term-ansicolor + thor + diff-lcs (1.2.5) + docile (1.1.5) + ffi (1.9.6) + formatador (0.2.5) + guard (2.6.1) + formatador (>= 0.2.4) + listen (~> 2.7) + lumberjack (~> 1.0) + pry (>= 0.9.12) + thor (>= 0.18.1) + guard-rspec (4.2.10) + guard (~> 2.1) + rspec (>= 2.14, < 4.0) + hitimes (1.2.2) + i18n (0.7.0) + json (1.8.1) + listen (2.8.4) + celluloid (>= 0.15.2) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + lumberjack (1.0.9) + method_source (0.8.2) + mime-types (2.4.3) + minitest (5.5.0) + multi_json (1.10.1) + mysql2 (0.3.17) + netrc (0.10.2) + pg (0.17.1) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + rake (10.3.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) + ffi (>= 0.5.0) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.8) + rspec-expectations (2.14.5) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.6) + simplecov (0.9.1) + docile (~> 1.1.0) + multi_json (~> 1.0) + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + slop (3.6.0) + sqlite3 (1.3.10) + term-ansicolor (1.3.0) + tins (~> 1.0) + thor (0.19.1) + thread_safe (0.3.4) + timers (4.0.1) + hitimes + tins (1.3.3) + tzinfo (1.2.2) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 4.2.0) + activesupport (~> 4.2.0) + appraisal (~> 1.0.0) + coveralls + crypt_keeper! + guard (~> 2.6.1) + guard-rspec (~> 4.2.9) + mysql2 (~> 0.3.11) + pg (~> 0.17.1) + rake (~> 10.3.1) + rb-fsevent (~> 0.9.1) + rspec (~> 2.14.0) + sqlite3 diff --git a/lib/crypt_keeper/provider/mysql_aes_new.rb b/lib/crypt_keeper/provider/mysql_aes_new.rb index 4298a2a..5d71107 100644 --- a/lib/crypt_keeper/provider/mysql_aes_new.rb +++ b/lib/crypt_keeper/provider/mysql_aes_new.rb @@ -36,7 +36,7 @@ def decrypt(value) # # Returns an Enumerable def search(records, field, criteria) - records.where(field.to_sym => encrypt(criteria)) + records.where("#{field} = ?", encrypt(criteria)) end end end