Permalink
Browse files

Removing nasty Time#to_json overwrite

  • Loading branch information...
1 parent 1e4ed38 commit 8573a3e6cfda65d5cae9daafd33cf34100b76b31 @samlown samlown committed Apr 4, 2011
Showing with 22 additions and 21 deletions.
  1. +4 −0 Gemfile.lock
  2. +6 −0 README.md
  3. +2 −2 couchrest.gemspec
  4. +8 −0 history.txt
  5. +2 −19 lib/couchrest/monkeypatches.rb
View
@@ -9,6 +9,7 @@ PATH
GEM
remote: http://rubygems.org/
specs:
+ json (1.5.1)
json (1.5.1-java)
mime-types (1.16)
rest-client (1.6.1)
@@ -21,4 +22,7 @@ PLATFORMS
DEPENDENCIES
couchrest!
+ json (~> 1.5.1)
+ mime-types (~> 1.15)
+ rest-client (~> 1.6.1)
rspec (~> 1.3.0)
View
@@ -10,6 +10,12 @@ CouchRest is designed to make a simple base for application and framework-specif
**Note: CouchRest only support CouchDB 0.9.0 or newer. Some features requires CouchDB 0.10.0 or newer.**
+## Important Upgrade Notice
+
+### 2011-04-04: Time#to_json no longer overwritten!
+
+Now sticking to JSON standard format. Ensure you views using Time will be ordered correctly after upgrade!
+
## Easy Install
$ sudo gem install couchrest
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{couchrest}
- s.version = "1.0.2"
+ s.version = "1.0.3"
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{2011-03-13}
+ s.date = %q{2011-04-04}
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}
View
@@ -1,3 +1,11 @@
+== 1.0.3
+
+* Major changes
+ * Time#to_json monkey patch removed! Standard methods now used instead.
+
+WARNING: If you depend on ordering by Time, this change may cause issues! Either update
+your documents to use the new format, or use the Date.parse method in your views.
+
== 1.0.2
* Minor enhancements
@@ -1,22 +1,7 @@
-require 'timeout'
-
-# This file must be loaded after the JSON gem and any other library that beats up the Time class.
-class Time
- # This date format sorts lexicographically
- # and is compatible with Javascript's <tt>new Date(time_string)</tt> constructor.
- # Note this this format stores all dates in UTC so that collation
- # order is preserved. (There's no longer a need to set <tt>ENV['TZ'] = 'UTC'</tt>
- # in your application.)
-
- def to_json(options = nil)
- u = self.getutc
- %("#{u.strftime("%Y/%m/%d %H:%M:%S +0000")}")
- end
-
-end
-
# Monkey patch for faster net/http io
if RUBY_VERSION.to_f < 1.9
+ require 'timeout'
+
class Net::BufferedIO #:nodoc:
alias :old_rbuf_fill :rbuf_fill
def rbuf_fill
@@ -38,5 +23,3 @@ def rbuf_fill
end
end
end
-
-

0 comments on commit 8573a3e

Please sign in to comment.