From 059ecec29f0fd0d10846e149c7fb0236085e724f Mon Sep 17 00:00:00 2001 From: Hamed Asghari Date: Wed, 28 Mar 2018 17:40:08 -0700 Subject: [PATCH] Update for postgres 10 support --- .gitignore | 1 + .travis.yml | 2 +- Appraisals | 4 +- ...5.1.gemfile => activerecord_5.1.5.gemfile} | 2 +- gemfiles/activerecord_5.1.5.gemfile.lock | 117 ++++++++++++++++++ gemfiles/activerecord_5.1.gemfile.lock | 116 ----------------- parentry.gemspec | 8 +- spec/{db => internal/config}/database.yml | 0 spec/internal/db/database.yml | 5 + spec/{ => internal}/db/schema.rb | 0 spec/spec_helper.rb | 14 +-- 11 files changed, 135 insertions(+), 134 deletions(-) rename gemfiles/{activerecord_5.1.gemfile => activerecord_5.1.5.gemfile} (78%) create mode 100644 gemfiles/activerecord_5.1.5.gemfile.lock delete mode 100644 gemfiles/activerecord_5.1.gemfile.lock rename spec/{db => internal/config}/database.yml (100%) create mode 100644 spec/internal/db/database.yml rename spec/{ => internal}/db/schema.rb (100%) diff --git a/.gitignore b/.gitignore index c7673fa..4d36cec 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ .ruby-gemset .ruby-version /vendor/ +/spec/internal/log/* diff --git a/.travis.yml b/.travis.yml index 8fe7e61..d8052f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ env: - STRATEGY=array - STRATEGY=ltree gemfile: - - gemfiles/activerecord_5.1.gemfile + - gemfiles/activerecord_5.1.5.gemfile before_install: gem install bundler -v 1.10.6 diff --git a/Appraisals b/Appraisals index d23fcfa..b4842dc 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,3 @@ -appraise 'activerecord-5.1' do - gem 'activerecord', '~> 5.1.0' +appraise 'activerecord-5.1.5' do + gem 'activerecord', '5.1.5' end diff --git a/gemfiles/activerecord_5.1.gemfile b/gemfiles/activerecord_5.1.5.gemfile similarity index 78% rename from gemfiles/activerecord_5.1.gemfile rename to gemfiles/activerecord_5.1.5.gemfile index a4b9b13..f77a607 100644 --- a/gemfiles/activerecord_5.1.gemfile +++ b/gemfiles/activerecord_5.1.5.gemfile @@ -3,6 +3,6 @@ source "https://rubygems.org" gem "appraisal" -gem "activerecord", "~> 5.1.0" +gem "activerecord", "5.1.5" gemspec :path => "../" diff --git a/gemfiles/activerecord_5.1.5.gemfile.lock b/gemfiles/activerecord_5.1.5.gemfile.lock new file mode 100644 index 0000000..3c6f2fb --- /dev/null +++ b/gemfiles/activerecord_5.1.5.gemfile.lock @@ -0,0 +1,117 @@ +PATH + remote: .. + specs: + parentry (1.0.1) + activerecord (>= 5.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (5.1.5) + actionview (= 5.1.5) + activesupport (= 5.1.5) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.1.5) + activesupport (= 5.1.5) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activemodel (5.1.5) + activesupport (= 5.1.5) + activerecord (5.1.5) + activemodel (= 5.1.5) + activesupport (= 5.1.5) + arel (~> 8.0) + activesupport (5.1.5) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + arel (8.0.0) + builder (3.2.3) + coderay (1.1.2) + combustion (0.9.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + thor (>= 0.14.6) + concurrent-ruby (1.0.5) + crass (1.0.3) + database_cleaner (1.6.2) + diff-lcs (1.3) + erubi (1.7.1) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + method_source (0.9.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + pg (0.21.0) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + rack (2.0.4) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.1.5) + actionpack (= 5.1.5) + activesupport (= 5.1.5) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.5.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-rails (3.7.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + thor (0.20.0) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (= 5.1.5) + appraisal + bundler (~> 1.10) + combustion (= 0.9.0) + database_cleaner (~> 1.6) + parentry! + pg (~> 0.21) + pry (~> 0.10) + rake (~> 10.0) + rspec-rails (~> 3.7) + +BUNDLED WITH + 1.14.6 diff --git a/gemfiles/activerecord_5.1.gemfile.lock b/gemfiles/activerecord_5.1.gemfile.lock deleted file mode 100644 index 2896aa1..0000000 --- a/gemfiles/activerecord_5.1.gemfile.lock +++ /dev/null @@ -1,116 +0,0 @@ -PATH - remote: .. - specs: - parentry (1.0.1) - activerecord (~> 5.1) - -GEM - remote: https://rubygems.org/ - specs: - actionpack (5.1.1) - actionview (= 5.1.1) - activesupport (= 5.1.1) - rack (~> 2.0) - rack-test (~> 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.1) - activesupport (= 5.1.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activemodel (5.1.1) - activesupport (= 5.1.1) - activerecord (5.1.1) - activemodel (= 5.1.1) - activesupport (= 5.1.1) - arel (~> 8.0) - activesupport (5.1.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (8.0.0) - builder (3.2.3) - coderay (1.1.1) - combustion (0.5.3) - activesupport (>= 3.0.0) - railties (>= 3.0.0) - thor (>= 0.14.6) - concurrent-ruby (1.0.5) - database_cleaner (1.6.1) - diff-lcs (1.3) - erubi (1.6.0) - i18n (0.8.1) - loofah (2.0.3) - nokogiri (>= 1.5.9) - method_source (0.8.2) - mini_portile2 (2.1.0) - minitest (5.10.2) - nokogiri (1.7.2) - mini_portile2 (~> 2.1.0) - pg (0.20.0) - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (5.1.1) - actionpack (= 5.1.1) - activesupport (= 5.1.1) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.5.0) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-rails (3.6.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-support (~> 3.6.0) - rspec-support (3.6.0) - slop (3.6.0) - thor (0.19.4) - thread_safe (0.3.6) - tzinfo (1.2.3) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 5.1.0) - appraisal - bundler (~> 1.10) - combustion (= 0.5.3) - database_cleaner (~> 1.6) - parentry! - pg (~> 0.20) - pry (~> 0.10) - rake (~> 10.0) - rspec-rails (~> 3.6) - -BUNDLED WITH - 1.14.6 diff --git a/parentry.gemspec b/parentry.gemspec index 1bcf0f1..11b194c 100644 --- a/parentry.gemspec +++ b/parentry.gemspec @@ -16,13 +16,13 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.require_paths = ['lib'] - spec.add_dependency 'activerecord', '~> 5.1' + spec.add_dependency 'activerecord', '>= 5.1' spec.add_development_dependency 'bundler', '~> 1.10' spec.add_development_dependency 'rake', '~> 10.0' - spec.add_development_dependency 'rspec-rails', '~> 3.6' - spec.add_development_dependency 'pg', '~> 0.20' - spec.add_development_dependency 'combustion', '0.5.3' + spec.add_development_dependency 'rspec-rails', '~> 3.7' + spec.add_development_dependency 'pg', '~> 0.21' + spec.add_development_dependency 'combustion', '0.9.0' spec.add_development_dependency 'database_cleaner', '~> 1.6' spec.add_development_dependency 'pry', '~> 0.10' end diff --git a/spec/db/database.yml b/spec/internal/config/database.yml similarity index 100% rename from spec/db/database.yml rename to spec/internal/config/database.yml diff --git a/spec/internal/db/database.yml b/spec/internal/db/database.yml new file mode 100644 index 0000000..09b4ed3 --- /dev/null +++ b/spec/internal/db/database.yml @@ -0,0 +1,5 @@ +test: + adapter: postgresql + host: localhost + database: parentry_test + username: postgres diff --git a/spec/db/schema.rb b/spec/internal/db/schema.rb similarity index 100% rename from spec/db/schema.rb rename to spec/internal/db/schema.rb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c659762..6a17de0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,17 +1,12 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) + +require 'combustion' +Combustion.initialize! :active_record + require 'yaml' require 'erb' -require 'active_record' require 'pry' -ActiveRecord::Base.configurations = YAML.load(ERB.new(IO.read(File.dirname(__FILE__) + '/db/database.yml')).result) -ActiveRecord::Base.establish_connection(:test) -ActiveRecord::Migration.verbose = false - -require 'combustion/database' -Combustion::Database.create_database(ActiveRecord::Base.configurations['test']) -load File.join(File.dirname(__FILE__), 'db', 'schema.rb') - require 'parentry' require 'support/models' @@ -27,7 +22,6 @@ DatabaseCleaner.strategy = :transaction config.before(:suite) { DatabaseCleaner.clean_with :truncation } - config.after(:suite) { Combustion::Database.drop_database(ActiveRecord::Base.configurations['test']) } config.before { DatabaseCleaner.start } config.after { DatabaseCleaner.clean }