diff --git a/.gitignore b/.gitignore index e1d9273..a5c005f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .DS_Store html/* pkg -*.swp -couchrest.gemspec +*.swp \ No newline at end of file diff --git a/README.md b/README.md index ddc7460..2e0bfd0 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ Check the wiki for documentation and examples [http://wiki.github.com/couchrest/ ## Contact -Please post bugs, suggestions and patches to the bug tracker at . +Please post bugs, suggestions and patches to the bug tracker at [http://github.com/couchrest/couchrest/issues](http://github.com/couchrest/couchrest/issues). -Follow us on Twitter: http://twitter.com/couchrest +Follow us on Twitter: [http://twitter.com/couchrest](http://twitter.com/couchrest) -Also, check http://twitter.com/#search?q=%23couchrest +Also, check [http://twitter.com/#search?q=%23couchrest](http://twitter.com/#search?q=%23couchrest) ## Ruby on Rails diff --git a/Rakefile b/Rakefile index 2c4ee9e..f62ddc8 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,7 @@ begin gemspec.homepage = "http://github.com/couchrest/couchrest" gemspec.authors = ["J. Chris Anderson", "Matt Aimonetti", "Marcos Tapajos", "Will Leinweber"] gemspec.extra_rdoc_files = %w( README.md LICENSE THANKS.md ) - gemspec.files = %w( LICENSE README.md Rakefile THANKS.md history.txt) + 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,utils}/**/*"] - Dir["spec/tmp"] gemspec.has_rdoc = true gemspec.add_dependency("rest-client", ">= 0.5") gemspec.add_dependency("mime-types", ">= 1.15") diff --git a/couchrest.gemspec b/couchrest.gemspec new file mode 100644 index 0000000..a64f660 --- /dev/null +++ b/couchrest.gemspec @@ -0,0 +1,182 @@ +# 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} + s.version = "0.37" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["J. Chris Anderson", "Matt Aimonetti", "Marcos Tapajos", "Will Leinweber"] + s.date = %q{2010-03-30} + s.description = %q{CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments.} + s.email = %q{jchris@apache.org} + s.extra_rdoc_files = [ + "LICENSE", + "README.md", + "THANKS.md" + ] + s.files = [ + "LICENSE", + "README.md", + "Rakefile", + "THANKS.md", + "couchrest.gemspec", + "examples/model/example.rb", + "examples/word_count/markov", + "examples/word_count/views/books/chunked-map.js", + "examples/word_count/views/books/united-map.js", + "examples/word_count/views/markov/chain-map.js", + "examples/word_count/views/markov/chain-reduce.js", + "examples/word_count/views/word_count/count-map.js", + "examples/word_count/views/word_count/count-reduce.js", + "examples/word_count/word_count.rb", + "examples/word_count/word_count_query.rb", + "examples/word_count/word_count_views.rb", + "history.txt", + "lib/couchrest.rb", + "lib/couchrest/commands/generate.rb", + "lib/couchrest/commands/push.rb", + "lib/couchrest/core/adapters/restclient.rb", + "lib/couchrest/core/database.rb", + "lib/couchrest/core/design.rb", + "lib/couchrest/core/document.rb", + "lib/couchrest/core/http_abstraction.rb", + "lib/couchrest/core/response.rb", + "lib/couchrest/core/rest_api.rb", + "lib/couchrest/core/server.rb", + "lib/couchrest/core/view.rb", + "lib/couchrest/helper/pager.rb", + "lib/couchrest/helper/streamer.rb", + "lib/couchrest/helper/upgrade.rb", + "lib/couchrest/middlewares/logger.rb", + "lib/couchrest/mixins.rb", + "lib/couchrest/mixins/attachments.rb", + "lib/couchrest/mixins/attribute_protection.rb", + "lib/couchrest/mixins/callbacks.rb", + "lib/couchrest/mixins/class_proxy.rb", + "lib/couchrest/mixins/collection.rb", + "lib/couchrest/mixins/design_doc.rb", + "lib/couchrest/mixins/document_queries.rb", + "lib/couchrest/mixins/extended_attachments.rb", + "lib/couchrest/mixins/extended_document_mixins.rb", + "lib/couchrest/mixins/properties.rb", + "lib/couchrest/mixins/validation.rb", + "lib/couchrest/mixins/views.rb", + "lib/couchrest/monkeypatches.rb", + "lib/couchrest/more/casted_model.rb", + "lib/couchrest/more/extended_document.rb", + "lib/couchrest/more/property.rb", + "lib/couchrest/more/typecast.rb", + "lib/couchrest/support/blank.rb", + "lib/couchrest/support/class.rb", + "lib/couchrest/support/rails.rb", + "lib/couchrest/validation/auto_validate.rb", + "lib/couchrest/validation/contextual_validators.rb", + "lib/couchrest/validation/validation_errors.rb", + "lib/couchrest/validation/validators/absent_field_validator.rb", + "lib/couchrest/validation/validators/confirmation_validator.rb", + "lib/couchrest/validation/validators/format_validator.rb", + "lib/couchrest/validation/validators/formats/email.rb", + "lib/couchrest/validation/validators/formats/url.rb", + "lib/couchrest/validation/validators/generic_validator.rb", + "lib/couchrest/validation/validators/length_validator.rb", + "lib/couchrest/validation/validators/method_validator.rb", + "lib/couchrest/validation/validators/numeric_validator.rb", + "lib/couchrest/validation/validators/required_field_validator.rb", + "spec/couchrest/core/couchrest_spec.rb", + "spec/couchrest/core/database_spec.rb", + "spec/couchrest/core/design_spec.rb", + "spec/couchrest/core/document_spec.rb", + "spec/couchrest/core/server_spec.rb", + "spec/couchrest/helpers/pager_spec.rb", + "spec/couchrest/helpers/streamer_spec.rb", + "spec/couchrest/more/attribute_protection_spec.rb", + "spec/couchrest/more/casted_extended_doc_spec.rb", + "spec/couchrest/more/casted_model_spec.rb", + "spec/couchrest/more/extended_doc_attachment_spec.rb", + "spec/couchrest/more/extended_doc_inherited_spec.rb", + "spec/couchrest/more/extended_doc_spec.rb", + "spec/couchrest/more/extended_doc_subclass_spec.rb", + "spec/couchrest/more/extended_doc_view_spec.rb", + "spec/couchrest/more/property_spec.rb", + "spec/fixtures/attachments/README", + "spec/fixtures/attachments/couchdb.png", + "spec/fixtures/attachments/test.html", + "spec/fixtures/more/article.rb", + "spec/fixtures/more/card.rb", + "spec/fixtures/more/cat.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/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} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.6} + s.summary = %q{Lean and RESTful interface to CouchDB.} + s.test_files = [ + "spec/couchrest/core/couchrest_spec.rb", + "spec/couchrest/core/database_spec.rb", + "spec/couchrest/core/design_spec.rb", + "spec/couchrest/core/document_spec.rb", + "spec/couchrest/core/server_spec.rb", + "spec/couchrest/helpers/pager_spec.rb", + "spec/couchrest/helpers/streamer_spec.rb", + "spec/couchrest/more/attribute_protection_spec.rb", + "spec/couchrest/more/casted_extended_doc_spec.rb", + "spec/couchrest/more/casted_model_spec.rb", + "spec/couchrest/more/extended_doc_attachment_spec.rb", + "spec/couchrest/more/extended_doc_inherited_spec.rb", + "spec/couchrest/more/extended_doc_spec.rb", + "spec/couchrest/more/extended_doc_subclass_spec.rb", + "spec/couchrest/more/extended_doc_view_spec.rb", + "spec/couchrest/more/property_spec.rb", + "spec/fixtures/more/article.rb", + "spec/fixtures/more/card.rb", + "spec/fixtures/more/cat.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/service.rb", + "spec/fixtures/more/user.rb", + "spec/spec_helper.rb", + "examples/model/example.rb", + "examples/word_count/word_count.rb", + "examples/word_count/word_count_query.rb", + "examples/word_count/word_count_views.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, [">= 0.5"]) + s.add_runtime_dependency(%q, [">= 1.15"]) + else + s.add_dependency(%q, [">= 0.5"]) + s.add_dependency(%q, [">= 1.15"]) + end + else + s.add_dependency(%q, [">= 0.5"]) + s.add_dependency(%q, [">= 1.15"]) + end +end + diff --git a/history.txt b/history.txt index b097d51..48f3c76 100644 --- a/history.txt +++ b/history.txt @@ -1,10 +1,21 @@ == Next Version +* Major enhancements + +* Minor enhancements + +== 0.37 + +* Minor enhancements + * Added gemspec (needed for Bundler install) (Tapajós) + +== 0.36 + * Major enhancements * Adds support for continuous replication (sauy7) * Automatic Type Casting (Alexander Uvarov, Sam Lown, Tim Heighes, Will Leinweber) - * Added a search method to CouchRest:Database to search the documents in a - given database. (Dave Farkas, Arnaud Berthomier, John Wood) + * Added a search method to CouchRest:Database to search the documents in a given database. (Dave Farkas, Arnaud Berthomier, John Wood) + * Minor enhancements * Provide a description of the timeout error (John Wood) diff --git a/lib/couchrest.rb b/lib/couchrest.rb index 25f2f46..fd9701e 100644 --- a/lib/couchrest.rb +++ b/lib/couchrest.rb @@ -28,7 +28,7 @@ require 'couchrest/monkeypatches' # = CouchDB, close to the metal module CouchRest - VERSION = '0.35' unless self.const_defined?("VERSION") + VERSION = '0.37' unless self.const_defined?("VERSION") autoload :Server, 'couchrest/core/server' autoload :Database, 'couchrest/core/database' diff --git a/spec/couchrest/more/extended_doc_spec.rb b/spec/couchrest/more/extended_doc_spec.rb index c28b2cf..bfe1ac1 100644 --- a/spec/couchrest/more/extended_doc_spec.rb +++ b/spec/couchrest/more/extended_doc_spec.rb @@ -3,6 +3,7 @@ require File.expand_path("../../../spec_helper", __FILE__) require File.join(FIXTURE_PATH, 'more', 'article') require File.join(FIXTURE_PATH, 'more', 'course') +require File.join(FIXTURE_PATH, 'more', 'card') require File.join(FIXTURE_PATH, 'more', 'cat') describe "ExtendedDocument" do @@ -426,7 +427,16 @@ describe "ExtendedDocument" do obj.created_at.should be_an_instance_of(Time) obj.updated_at.should be_an_instance_of(Time) obj.created_at.to_s.should == @obj.updated_at.to_s - end + end + + it "should not change created_at on update" do + 2.times do + lambda do + @art.save + end.should_not change(@art, :created_at) + end + end + it "should set the time on create" do (Time.now - @art.created_at).should < 2 foundart = Article.get @art.id