From f718ce512220661d60885242b3153bbeee0d12aa Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Sun, 3 Aug 2014 22:48:13 -0700 Subject: [PATCH] if ENV['DB'] has mongodb then run rake mongoid else spec --- Gemfile | 2 +- Rakefile | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 0a70804..276f673 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,6 @@ else end end -if ENV['DB'] == 'mongodb' +if ENV['DB'] =~ /mongodb/ gem 'mongoid', '~> 4.0.0', require: false end diff --git a/Rakefile b/Rakefile index 10269b3..cc76efa 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,13 @@ RSpec::Core::RakeTask.new(:mongoid) do |rspec| rspec.rspec_opts = ['--backtrace'] end -task :default => :spec +task :default do + if ENV['DB'] =~ /mongodb/ + Rake::Task["mongoid"].invoke + else + Rake::Task["spec"].invoke + end +end desc "Open an irb session with Ransack and the sample data used in specs" task :console do