From fddb0f8242226f5277f208686f176a3c035feeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 3 Aug 2010 23:07:19 -0300 Subject: [PATCH 1/7] Removing old examples --- examples/model/example.rb | 144 -------------------------------------- 1 file changed, 144 deletions(-) delete mode 100644 examples/model/example.rb diff --git a/examples/model/example.rb b/examples/model/example.rb deleted file mode 100644 index 10d1536..0000000 --- a/examples/model/example.rb +++ /dev/null @@ -1,144 +0,0 @@ -require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'couchrest') - -def show obj - puts obj.inspect - puts -end - -SERVER = CouchRest.new -SERVER.default_database = 'couchrest-extendeddoc-example' - -class Author < CouchRest::ExtendedDocument - use_database SERVER.default_database - property :name - - def drink_scotch - puts "... glug type glug ... I'm #{name} ... type glug glug ..." - end -end - -class Post < CouchRest::ExtendedDocument - use_database SERVER.default_database - - property :title - property :body - property :author, :cast_as => 'Author' - - timestamps! -end - -class Comment < CouchRest::ExtendedDocument - use_database SERVER.default_database - - property :commenter, :cast_as => 'Author' - timestamps! - - def post= post - self["post_id"] = post.id - end - def post - Post.get(self['post_id']) if self['post_id'] - end - -end - -puts "Act I: CRUD" -puts -puts "(pause for dramatic effect)" -puts -sleep 2 - -puts "Create an author." -quentin = Author.new("name" => "Quentin Hazel") -show quentin - -puts "Create a new post." -post = Post.new(:title => "First Post", :body => "Lorem ipsum dolor sit amet, consectetur adipisicing elit...") -show post - -puts "Add the author to the post." -post.author = quentin -show post - -puts "Save the post." -post.save -show post - -puts "Load the post." -reloaded = Post.get(post.id) -show reloaded - -puts "The author of the post is an instance of Author." -reloaded.author.drink_scotch - -puts "\nAdd some comments to the post." -comment_one = Comment.new :text => "Blah blah blah", :commenter => {:name => "Joe Sixpack"} -comment_two = Comment.new :text => "Yeah yeah yeah", :commenter => {:name => "Jane Doe"} -comment_three = Comment.new :text => "Whatever...", :commenter => {:name => "John Stewart"} - -# TODO - maybe add some magic here? -comment_one.post = post -comment_two.post = post -comment_three.post = post -comment_one.save -comment_two.save -comment_three.save - -show comment_one -show comment_two -show comment_three - -puts "We can load a post through its comment (no magic here)." -show post = comment_one.post - -puts "Commenters are also authors." -comment_two['commenter'].drink_scotch -comment_one['commenter'].drink_scotch -comment_three['commenter'].drink_scotch - -puts "\nLet's save an author to her own document." -jane = comment_two['commenter'] -jane.save -show jane - -puts "Oh, that's neat! Because Ruby passes hash valuee by reference, Jane's new id has been added to the comment she left." -show comment_two - -puts "Of course, we'd better remember to save it." -comment_two.save -show comment_two - -puts "Oooh, denormalized... feel the burn!" -puts -puts -puts -puts "Act II: Views" -puts -puts -sleep 2 - -puts "Let's find all the comments that go with our post." -puts "Our post has id #{post.id}, so lets find all the comments with that post_id." -puts - -class Comment - view_by :post_id -end - -comments = Comment.by_post_id :key => post.id -show comments - -puts "That was too easy." -puts "We can even wrap it up in a finder on the Post class." -puts - -class Post - def comments - Comment.by_post_id :key => id - end -end - -show post.comments -puts "Gimme 5 minutes and I'll roll this into the framework. ;)" -puts -puts "There is a lot more that can be done with views, but a lot of the interesting stuff is joins, which of course range across types. We'll pick up where we left off, next time." \ No newline at end of file From c7acbc07ec6849f52fd4d5b72798c178dc9315cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 3 Aug 2010 23:09:05 -0300 Subject: [PATCH 2/7] Fixing documentation and two describes --- lib/couchrest/model/base.rb | 2 +- spec/couchrest/inherited_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/couchrest/model/base.rb b/lib/couchrest/model/base.rb index 5a80d49..2a5c602 100644 --- a/lib/couchrest/model/base.rb +++ b/lib/couchrest/model/base.rb @@ -39,7 +39,7 @@ module CouchRest attr_accessor :casted_by - # Instantiate a new ExtendedDocument by preparing all properties + # Instantiate a new CouchRest::Model::Base by preparing all properties # using the provided document hash. # # Options supported: diff --git a/spec/couchrest/inherited_spec.rb b/spec/couchrest/inherited_spec.rb index a661d01..69eba6a 100644 --- a/spec/couchrest/inherited_spec.rb +++ b/spec/couchrest/inherited_spec.rb @@ -21,14 +21,14 @@ begin class ExtendedChild < ExtendedParent end - describe "Using chained inheritance without CouchRest::ExtendedDocument" do + describe "Using chained inheritance without CouchRest::Model::Base" do it "should preserve inheritable attributes" do PlainParent.foo.should == :bar PlainChild.foo.should == :bar end end - describe "Using chained inheritance with CouchRest::ExtendedDocument" do + describe "Using chained inheritance with CouchRest::Model::Base" do it "should preserve inheritable attributes" do ExtendedParent.foo.should == :bar ExtendedChild.foo.should == :bar From 9466f67329a0138f6e799c3e9cbef68827bd5b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 3 Aug 2010 23:11:35 -0300 Subject: [PATCH 3/7] It isn't util --- Rakefile | 2 +- utils/remap.rb | 27 --------------------------- utils/subset.rb | 30 ------------------------------ 3 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 utils/remap.rb delete mode 100644 utils/subset.rb diff --git a/Rakefile b/Rakefile index 152592d..866c047 100644 --- a/Rakefile +++ b/Rakefile @@ -24,7 +24,7 @@ begin gemspec.homepage = "http://github.com/couchrest/couchrest_model" gemspec.authors = ["J. Chris Anderson", "Matt Aimonetti", "Marcos Tapajos", "Will Leinweber", "Sam Lown"] gemspec.extra_rdoc_files = %w( README.md LICENSE THANKS.md ) - gemspec.files = %w( LICENSE README.md Rakefile THANKS.md history.txt couchrest.gemspec) + Dir["{examples,lib,spec,utils}/**/*"] - Dir["spec/tmp"] + gemspec.files = %w( LICENSE README.md Rakefile THANKS.md history.txt couchrest.gemspec) + Dir["{examples,lib,spec}/**/*"] - Dir["spec/tmp"] gemspec.has_rdoc = true gemspec.add_dependency("couchrest", ">= 1.0.0.beta") gemspec.add_dependency("mime-types", ">= 1.15") diff --git a/utils/remap.rb b/utils/remap.rb deleted file mode 100644 index 131aeb3..0000000 --- a/utils/remap.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'rubygems' -require 'couchrest' - -# set the source db and map view -source = CouchRest.new("http://127.0.0.1:5984").database('source-db') -source_view = 'mydesign/view-map' - -# set the target db -target = CouchRest.new("http://127.0.0.1:5984").database('target-db') - - -pager = CouchRest::Pager.new(source) - -# pager will yield once per uniq key in the source view - -pager.key_reduce(source_view, 10000) do |key, values| - # create a doc from the key and the values - example_doc = { - :key => key, - :values => values.uniq - } - - target.save(example_doc) - - # keep us up to date with progress - puts k if (rand > 0.9) -end diff --git a/utils/subset.rb b/utils/subset.rb deleted file mode 100644 index 0b7adb9..0000000 --- a/utils/subset.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'rubygems' -require 'couchrest' - -# subset.rb replicates a percentage of a database to a fresh database. -# use it to create a smaller dataset on which to prototype views. - -# specify the source database -source = CouchRest.new("http://127.0.0.1:5984").database('source-db') - -# specify the target database -target = CouchRest.new("http://127.0.0.1:5984").database('target-db') - -# pager efficiently yields all view rows -pager = CouchRest::Pager.new(source) - -pager.all_docs(1000) do |rows| - docs = rows.collect do |r| - # the percentage of docs to clone - next if rand > 0.1 - doc = source.get(r['id']) - doc.delete('_rev') - doc - end.compact - puts docs.length - next if docs.empty? - - puts docs.first['_id'] - target.bulk_save(docs) -end - From 0d72447e31198c9b017f6c1327213c44a3dcf9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 3 Aug 2010 23:20:29 -0300 Subject: [PATCH 4/7] Checking if attachment is really deleted from database --- spec/couchrest/attachment_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/couchrest/attachment_spec.rb b/spec/couchrest/attachment_spec.rb index 75331e1..ac3de02 100644 --- a/spec/couchrest/attachment_spec.rb +++ b/spec/couchrest/attachment_spec.rb @@ -30,6 +30,13 @@ describe "Model attachments" do @obj.delete_attachment(@attachment_name) @obj.has_attachment?(@attachment_name).should be_false end + + it 'should return false if an attachment has been removed and reloaded' do + @obj.delete_attachment(@attachment_name) + reloaded_obj = Basic.get(@obj.id) + reloaded_obj.has_attachment?(@attachment_name).should be_false + end + end describe "creating an attachment" do From 33657d9470d5cf6b0ddcd4ac098956c8f06de988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 3 Aug 2010 23:57:51 -0300 Subject: [PATCH 5/7] creating attachments accessor --- lib/couchrest/model/extended_attachments.rb | 14 ++++++--- spec/couchrest/attachment_spec.rb | 35 ++++++++++++++++----- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/lib/couchrest/model/extended_attachments.rb b/lib/couchrest/model/extended_attachments.rb index 8d1e6ed..42bccec 100644 --- a/lib/couchrest/model/extended_attachments.rb +++ b/lib/couchrest/model/extended_attachments.rb @@ -7,11 +7,15 @@ module CouchRest def create_attachment(args={}) raise ArgumentError unless args[:file] && args[:name] return if has_attachment?(args[:name]) - self['_attachments'] ||= {} set_attachment_attr(args) rescue ArgumentError => e raise ArgumentError, 'You must specify :file and :name' end + + # return all attachments + def attachments + self['_attachments'] ||= {} + end # reads the data from an attachment def read_attachment(attachment_name) @@ -30,13 +34,13 @@ module CouchRest # deletes a file attachment from the current doc def delete_attachment(attachment_name) - return unless self['_attachments'] - self['_attachments'].delete attachment_name + return unless attachments + attachments.delete attachment_name end # returns true if attachment_name exists def has_attachment?(attachment_name) - !!(self['_attachments'] && self['_attachments'][attachment_name] && !self['_attachments'][attachment_name].empty?) + !!(attachments && attachments[attachment_name] && !attachments[attachment_name].empty?) end # returns URL to fetch the attachment from @@ -62,7 +66,7 @@ module CouchRest def set_attachment_attr(args) content_type = args[:content_type] ? args[:content_type] : get_mime_type(args[:file].path) content_type ||= (get_mime_type(args[:name]) || 'text/plain') - self['_attachments'][args[:name]] = { + attachments[args[:name]] = { 'content_type' => content_type, 'data' => args[:file].read } diff --git a/spec/couchrest/attachment_spec.rb b/spec/couchrest/attachment_spec.rb index ac3de02..420b88c 100644 --- a/spec/couchrest/attachment_spec.rb +++ b/spec/couchrest/attachment_spec.rb @@ -53,14 +53,14 @@ describe "Model attachments" do @obj.create_attachment(:file => @file_ext, :name => @attachment_name) @obj.save.should be_true reloaded_obj = Basic.get(@obj.id) - reloaded_obj['_attachments'][@attachment_name].should_not be_nil + reloaded_obj.attachments[@attachment_name].should_not be_nil end it "should create an attachment from file without an extension" do @obj.create_attachment(:file => @file_no_ext, :name => @attachment_name) @obj.save.should be_true reloaded_obj = Basic.get(@obj.id) - reloaded_obj['_attachments'][@attachment_name].should_not be_nil + reloaded_obj.attachments[@attachment_name].should_not be_nil end it 'should raise ArgumentError if :file is missing' do @@ -73,19 +73,19 @@ describe "Model attachments" do it 'should set the content-type if passed' do @obj.create_attachment(:file => @file_ext, :name => @attachment_name, :content_type => @content_type) - @obj['_attachments'][@attachment_name]['content_type'].should == @content_type + @obj.attachments[@attachment_name]['content_type'].should == @content_type end it "should detect the content-type automatically" do @obj.create_attachment(:file => File.open(FIXTURE_PATH + '/attachments/couchdb.png'), :name => "couchdb.png") - @obj['_attachments']['couchdb.png']['content_type'].should == "image/png" + @obj.attachments['couchdb.png']['content_type'].should == "image/png" end it "should use name to detect the content-type automatically if no file" do file = File.open(FIXTURE_PATH + '/attachments/couchdb.png') file.stub!(:path).and_return("badfilname") @obj.create_attachment(:file => File.open(FIXTURE_PATH + '/attachments/couchdb.png'), :name => "couchdb.png") - @obj['_attachments']['couchdb.png']['content_type'].should == "image/png" + @obj.attachments['couchdb.png']['content_type'].should == "image/png" end end @@ -120,7 +120,7 @@ describe "Model attachments" do file = File.open(FIXTURE_PATH + '/attachments/README') @file.should_not == file @obj.update_attachment(:file => file, :name => @attachment_name, :content_type => @content_type) - @obj['_attachments'][@attachment_name]['content_type'].should == @content_type + @obj.attachments[@attachment_name]['content_type'].should == @content_type end it 'should delete an attachment that exists' do @@ -150,6 +150,27 @@ describe "Model attachments" do it 'should return the attachment URI' do @obj.attachment_uri(@attachment_name).should == "#{Basic.database.uri}/#{@obj.id}/#{@attachment_name}" end - + end + + describe "#attachments" do + before(:each) do + @obj = Basic.new + @file = File.open(FIXTURE_PATH + '/attachments/test.html') + @attachment_name = 'my_attachment' + @obj.create_attachment(:file => @file, :name => @attachment_name) + @obj.save.should be_true + end + + it 'should return an empty Hash when document does not have any attachment' do + new_obj = Basic.new + new_obj.save.should be_true + new_obj.attachments.should == {} + end + + it 'should return a Hash with all attachments' do + @file.rewind + @obj.attachments.should == { @attachment_name =>{ "data" => "PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlRlc3Q8L3RpdGxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxwPgogICAgICBUZXN0CiAgICA8L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==", "content_type" => "text/html"}} + end + end end From 796f7d9f7eeed12d29b6d3eb03f492f60b66e791 Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Wed, 4 Aug 2010 11:54:02 +0200 Subject: [PATCH 6/7] Raising an error when adding an un-saved item to a collection --- lib/couchrest/model/associations.rb | 12 ++++++++++++ spec/couchrest/assocations_spec.rb | 13 ++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/couchrest/model/associations.rb b/lib/couchrest/model/associations.rb index 0f83f3e..889ff5c 100644 --- a/lib/couchrest/model/associations.rb +++ b/lib/couchrest/model/associations.rb @@ -171,27 +171,32 @@ module CouchRest (array ||= []).compact! casted_by[property.to_s] = [] # replace the original array! array.compact.each do |obj| + check_obj(obj) casted_by[property.to_s] << obj.id end super(array) end def << obj + check_obj(obj) casted_by[property.to_s] << obj.id super(obj) end def push(obj) + check_obj(obj) casted_by[property.to_s].push obj.id super(obj) end def unshift(obj) + check_obj(obj) casted_by[property.to_s].unshift obj.id super(obj) end def []= index, obj + check_obj(obj) casted_by[property.to_s][index] = obj.id super(index, obj) end @@ -205,6 +210,13 @@ module CouchRest casted_by[property.to_s].shift super end + + protected + + def check_obj(obj) + raise "Object cannot be added to #{casted_by.class.to_s}##{property.to_s} collection unless saved" if obj.new? + end + end diff --git a/spec/couchrest/assocations_spec.rb b/spec/couchrest/assocations_spec.rb index 21ad658..deef3cb 100644 --- a/spec/couchrest/assocations_spec.rb +++ b/spec/couchrest/assocations_spec.rb @@ -178,16 +178,19 @@ describe "Assocations" do @invoice.entry_ids.first.should eql(@entries[1].id) end - it "should save all entries when invoice is saved" do + it "should raise error when adding un-persisted entries" do SaleEntry.find_by_description('test entry').should be_nil entry = SaleEntry.new(:description => 'test entry', :price => 500) - @invoice.entries << entry - @invoice.save.should be_true - SaleEntry.find_by_description('test entry').should_not be_nil + lambda { + @invoice.entries << entry + }.should raise_error + # In the future maybe? + # @invoice.save.should be_true + # SaleEntry.find_by_description('test entry').should_not be_nil end end end -end \ No newline at end of file +end From dfd9dd0e73e4691a2829cfca59f17e07ba5d2a7a Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Wed, 11 Aug 2010 17:35:15 +0200 Subject: [PATCH 7/7] Updating readme and using stable couchrest 1.0.0 for base --- .gitignore | 1 - README.md | 19 ++++- Rakefile | 2 +- couchrest_model.gemspec | 155 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 couchrest_model.gemspec diff --git a/.gitignore b/.gitignore index f854a69..2318685 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ html/* pkg *.swp -*.gemspec diff --git a/README.md b/README.md index 73fc714..c701026 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,24 @@ CouchRest Model only supports CouchDB 0.10.0 or newer. ## Install - $ sudo gem install couchrest_model +### From Gem + +CouchRest Model depends on Rails 3's ActiveModel which has not yet been released. You'll need to add +`--pre` to the end of the gem install until the dependencies are stable: + + $ sudo gem install couchrest_model --pre + +### Bundler + +If you're using bundler, just define a line similar to the following in your project's Gemfile: + + gem 'couchrest_model' + +You might also consider using the latest git repository. All tests should pass in the master code branch +but no guarantees! + + gem 'couchrest_model', :git => 'git://github.com/couchrest/couchrest_model.git' + ## General Usage diff --git a/Rakefile b/Rakefile index 152592d..a495e1c 100644 --- a/Rakefile +++ b/Rakefile @@ -26,7 +26,7 @@ begin gemspec.extra_rdoc_files = %w( README.md LICENSE THANKS.md ) gemspec.files = %w( LICENSE README.md Rakefile THANKS.md history.txt couchrest.gemspec) + Dir["{examples,lib,spec,utils}/**/*"] - Dir["spec/tmp"] gemspec.has_rdoc = true - gemspec.add_dependency("couchrest", ">= 1.0.0.beta") + 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") diff --git a/couchrest_model.gemspec b/couchrest_model.gemspec new file mode 100644 index 0000000..3ccdac5 --- /dev/null +++ b/couchrest_model.gemspec @@ -0,0 +1,155 @@ +# Generated by jeweler +# DO NOT EDIT THIS FILE DIRECTLY +# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{couchrest_model} + s.version = "1.0.0.beta7" + + s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= + s.authors = ["J. Chris Anderson", "Matt Aimonetti", "Marcos Tapajos", "Will Leinweber", "Sam Lown"] + s.date = %q{2010-08-11} + s.description = %q{CouchRest Model provides aditional features to the standard CouchRest Document class such as properties, view designs, associations, callbacks, typecasting and validations.} + s.email = %q{jchris@apache.org} + s.extra_rdoc_files = [ + "LICENSE", + "README.md", + "THANKS.md" + ] + s.files = [ + "LICENSE", + "README.md", + "Rakefile", + "THANKS.md", + "examples/model/example.rb", + "history.txt", + "lib/couchrest/model.rb", + "lib/couchrest/model/associations.rb", + "lib/couchrest/model/attribute_protection.rb", + "lib/couchrest/model/attributes.rb", + "lib/couchrest/model/base.rb", + "lib/couchrest/model/callbacks.rb", + "lib/couchrest/model/casted_array.rb", + "lib/couchrest/model/casted_model.rb", + "lib/couchrest/model/class_proxy.rb", + "lib/couchrest/model/collection.rb", + "lib/couchrest/model/design_doc.rb", + "lib/couchrest/model/document_queries.rb", + "lib/couchrest/model/errors.rb", + "lib/couchrest/model/extended_attachments.rb", + "lib/couchrest/model/persistence.rb", + "lib/couchrest/model/properties.rb", + "lib/couchrest/model/property.rb", + "lib/couchrest/model/support/couchrest.rb", + "lib/couchrest/model/support/hash.rb", + "lib/couchrest/model/typecast.rb", + "lib/couchrest/model/validations.rb", + "lib/couchrest/model/validations/casted_model.rb", + "lib/couchrest/model/validations/locale/en.yml", + "lib/couchrest/model/validations/uniqueness.rb", + "lib/couchrest/model/views.rb", + "lib/couchrest_model.rb", + "spec/couchrest/assocations_spec.rb", + "spec/couchrest/attachment_spec.rb", + "spec/couchrest/attribute_protection_spec.rb", + "spec/couchrest/base_spec.rb", + "spec/couchrest/casted_model_spec.rb", + "spec/couchrest/casted_spec.rb", + "spec/couchrest/class_proxy_spec.rb", + "spec/couchrest/inherited_spec.rb", + "spec/couchrest/persistence_spec.rb", + "spec/couchrest/property_spec.rb", + "spec/couchrest/subclass_spec.rb", + "spec/couchrest/validations.rb", + "spec/couchrest/view_spec.rb", + "spec/fixtures/attachments/README", + "spec/fixtures/attachments/couchdb.png", + "spec/fixtures/attachments/test.html", + "spec/fixtures/base.rb", + "spec/fixtures/more/article.rb", + "spec/fixtures/more/card.rb", + "spec/fixtures/more/cat.rb", + "spec/fixtures/more/client.rb", + "spec/fixtures/more/course.rb", + "spec/fixtures/more/event.rb", + "spec/fixtures/more/invoice.rb", + "spec/fixtures/more/person.rb", + "spec/fixtures/more/question.rb", + "spec/fixtures/more/sale_entry.rb", + "spec/fixtures/more/sale_invoice.rb", + "spec/fixtures/more/service.rb", + "spec/fixtures/more/user.rb", + "spec/fixtures/views/lib.js", + "spec/fixtures/views/test_view/lib.js", + "spec/fixtures/views/test_view/only-map.js", + "spec/fixtures/views/test_view/test-map.js", + "spec/fixtures/views/test_view/test-reduce.js", + "spec/spec.opts", + "spec/spec_helper.rb", + "utils/remap.rb", + "utils/subset.rb" + ] + s.homepage = %q{http://github.com/couchrest/couchrest_model} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.6} + s.summary = %q{Extends the CouchRest Document for advanced modelling.} + s.test_files = [ + "spec/spec_helper.rb", + "spec/couchrest/property_spec.rb", + "spec/couchrest/casted_spec.rb", + "spec/couchrest/subclass_spec.rb", + "spec/couchrest/persistence_spec.rb", + "spec/couchrest/casted_model_spec.rb", + "spec/couchrest/attribute_protection_spec.rb", + "spec/couchrest/assocations_spec.rb", + "spec/couchrest/validations.rb", + "spec/couchrest/view_spec.rb", + "spec/couchrest/inherited_spec.rb", + "spec/couchrest/attachment_spec.rb", + "spec/couchrest/class_proxy_spec.rb", + "spec/couchrest/base_spec.rb", + "spec/fixtures/base.rb", + "spec/fixtures/more/card.rb", + "spec/fixtures/more/event.rb", + "spec/fixtures/more/user.rb", + "spec/fixtures/more/sale_invoice.rb", + "spec/fixtures/more/article.rb", + "spec/fixtures/more/service.rb", + "spec/fixtures/more/invoice.rb", + "spec/fixtures/more/person.rb", + "spec/fixtures/more/question.rb", + "spec/fixtures/more/cat.rb", + "spec/fixtures/more/client.rb", + "spec/fixtures/more/sale_entry.rb", + "spec/fixtures/more/course.rb", + "examples/model/example.rb" + ] + + if s.respond_to? :specification_version then + current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + s.specification_version = 3 + + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, [">= 1.0.0"]) + s.add_runtime_dependency(%q, [">= 1.15"]) + s.add_runtime_dependency(%q, [">= 2.3.5"]) + s.add_runtime_dependency(%q, [">= 3.0.0.beta4"]) + s.add_runtime_dependency(%q, [">= 0.3.22"]) + else + s.add_dependency(%q, [">= 1.0.0"]) + s.add_dependency(%q, [">= 1.15"]) + s.add_dependency(%q, [">= 2.3.5"]) + s.add_dependency(%q, [">= 3.0.0.beta4"]) + s.add_dependency(%q, [">= 0.3.22"]) + end + else + s.add_dependency(%q, [">= 1.0.0"]) + s.add_dependency(%q, [">= 1.15"]) + s.add_dependency(%q, [">= 2.3.5"]) + s.add_dependency(%q, [">= 3.0.0.beta4"]) + s.add_dependency(%q, [">= 0.3.22"]) + end +end +