From 2dc2a573f9783c127c6ae251bc882d1dea20ef1b Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Wed, 29 Dec 2010 13:22:14 -0800 Subject: [PATCH] move mongoid/dm gems into Gemfile and load dynamically based on MODEL_ADAPTER env variable --- Gemfile | 8 ++++++++ cancan.gemspec | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 1aa98e4..4e1c66e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,10 @@ source "http://rubygems.org" gemspec + +case ENV["MODEL_ADAPTER"] +when "mongoid" + gem "bson_ext", "~> 1.1" + gem "mongoid", "~> 2.0.0.beta.19" +when "data_mapper" + gem "dm-core", "~> 1.0.2" +end diff --git a/cancan.gemspec b/cancan.gemspec index 40cae4b..9e54a8a 100644 --- a/cancan.gemspec +++ b/cancan.gemspec @@ -15,10 +15,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'rr', '~> 0.10.11' # 1.0.0 has respond_to? issues: http://github.com/btakita/rr/issues/issue/43 s.add_development_dependency 'supermodel', '~> 0.1.4' - s.add_development_dependency 'mongoid', '~> 2.0.0.beta.19' - s.add_development_dependency 'bson_ext', '~> 1.1' - s.add_development_dependency 'dm-core', '~> 1.0.2' - s.rubyforge_project = s.name s.required_rubygems_version = ">= 1.3.4" end