diff --git a/Rakefile b/Rakefile index 6f2ec02..0f2d417 100644 --- a/Rakefile +++ b/Rakefile @@ -5,7 +5,8 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__) require 'couchrest_model' begin - require 'spec/rake/spectask' + require 'rspec' + require 'rspec/core/rake_task' rescue LoadError puts <<-EOS To use rspec for testing you must install rspec gem: @@ -28,8 +29,8 @@ begin gemspec.has_rdoc = true gemspec.add_dependency("couchrest", ">= 1.0.0") gemspec.add_dependency("mime-types", ">= 1.15") - gemspec.add_dependency("activesupport", ">= 2.3.5") - gemspec.add_dependency("activemodel", ">= 3.0.0.beta4") + gemspec.add_dependency("activesupport", ">= 3.0.0.rc") + gemspec.add_dependency("activemodel", ">= 3.0.0.rc") gemspec.add_dependency("tzinfo", ">= 0.3.22") gemspec.add_development_dependency('rspec', '>= 2.0.0.beta.19') gemspec.version = CouchRest::Model::VERSION @@ -41,15 +42,15 @@ rescue LoadError end desc "Run all specs" -Spec::Rake::SpecTask.new('spec') do |t| - t.spec_opts = ["--color"] - t.spec_files = FileList['spec/**/*_spec.rb'] +Rspec::Core::RakeTask.new(:spec) do |spec| + spec.spec_opts = ["--color"] + spec.pattern = 'spec/**/*_spec.rb' end desc "Print specdocs" -Spec::Rake::SpecTask.new(:doc) do |t| - t.spec_opts = ["--format", "specdoc"] - t.spec_files = FileList['spec/*_spec.rb'] +Rspec::Core::RakeTask.new(:doc) do |spec| + spec.spec_opts = ["--format", "specdoc"] + spec.pattern = 'spec/*_spec.rb' end desc "Generate the rdoc" diff --git a/lib/couchrest/model/design_doc.rb b/lib/couchrest/model/design_doc.rb index 8cdc8a7..244fba0 100644 --- a/lib/couchrest/model/design_doc.rb +++ b/lib/couchrest/model/design_doc.rb @@ -2,10 +2,7 @@ module CouchRest module Model module DesignDoc - - def self.included(base) - base.extend(ClassMethods) - end + extend ActiveSupport::Concern module ClassMethods diff --git a/lib/couchrest_model.rb b/lib/couchrest_model.rb index a2c2fd3..c19c38c 100644 --- a/lib/couchrest_model.rb +++ b/lib/couchrest_model.rb @@ -1,13 +1,13 @@ -gem 'couchrest', ">= 1.0.0.beta" +gem 'couchrest', ">= 1.0.0" require 'couchrest' gem "tzinfo", ">= 0.3.22" -gem "activesupport", ">= 2.3.5" +gem "activesupport", ">= 3.0.0.rc" require 'active_support/core_ext' require 'active_support/json' -gem "activemodel", ">= 3.0.0.beta4" +gem "activemodel", ">= 3.0.0.rc" require 'active_model' require "active_model/callbacks" require "active_model/conversion" diff --git a/spec/couchrest/base_spec.rb b/spec/couchrest/base_spec.rb index 1cfcd80..cd5fd4d 100644 --- a/spec/couchrest/base_spec.rb +++ b/spec/couchrest/base_spec.rb @@ -210,7 +210,7 @@ describe "Model Base" do describe "a doc with template values (CR::Model spec)" do before(:all) do - WithTemplateAndUniqueID.all.map{|o| o.destroy(true)} + WithTemplateAndUniqueID.all.map{|o| o.destroy} WithTemplateAndUniqueID.database.bulk_delete @tmpl = WithTemplateAndUniqueID.new @tmpl2 = WithTemplateAndUniqueID.new(:preset => 'not_value', 'important-field' => '1') @@ -233,7 +233,7 @@ describe "Model Base" do describe "finding all instances of a model" do before(:all) do WithTemplateAndUniqueID.req_design_doc_refresh - WithTemplateAndUniqueID.all.map{|o| o.destroy(true)} + WithTemplateAndUniqueID.all.map{|o| o.destroy} WithTemplateAndUniqueID.database.bulk_delete WithTemplateAndUniqueID.new('important-field' => '1').save WithTemplateAndUniqueID.new('important-field' => '2').save