From a4144af72d721857c7239dd7cdeca2327a0fb017 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Tue, 13 Jan 2009 20:08:58 -0800 Subject: [PATCH] fixup json time format --- Rakefile | 34 ---------------------------------- lib/couchrest/monkeypatches.rb | 2 +- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/Rakefile b/Rakefile index 0fdfdce..536670d 100644 --- a/Rakefile +++ b/Rakefile @@ -46,40 +46,6 @@ task :gemspec do end end -# desc "Update Github Gemspec" -# task :gemspec do -# skip_fields = %w(new_platform original_platform) -# integer_fields = %w(specification_version) -# -# result = "Gem::Specification.new do |s|\n" -# spec.instance_variables.each do |ivar| -# value = spec.instance_variable_get(ivar) -# name = ivar.split("@").last -# next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?) -# if name == "dependencies" -# value.each do |d| -# dep, *ver = d.to_s.split(" ") -# result << " s.add_dependency #{dep.inspect}, [#{ /\(([^\,]*)/ . match(ver.join(" "))[1].inspect}]\n" -# end -# else -# case value -# when Array -# value = name != "files" ? value.inspect : value.inspect.split(",").join(",\n") -# when Fixnum -# # leave as-is -# when String -# value = value.to_i if integer_fields.include?(name) -# value = value.inspect -# else -# value = value.to_s.inspect -# end -# result << " s.#{name} = #{value}\n" -# end -# end -# result << "end" -# File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result} -# end - desc "Run all specs" Spec::Rake::SpecTask.new('spec') do |t| t.spec_files = FileList['spec/**/*_spec.rb'] diff --git a/lib/couchrest/monkeypatches.rb b/lib/couchrest/monkeypatches.rb index da676d7..58b8fe9 100644 --- a/lib/couchrest/monkeypatches.rb +++ b/lib/couchrest/monkeypatches.rb @@ -8,7 +8,7 @@ class Time def to_json(options = nil) u = self.utc - %("#{u.strftime("%Y/%m/%d %H:%M:%S.#{u.usec} +0000")}") + %("#{u.strftime("%Y/%m/%d %H:%M:%S +0000")}") end # Decodes the JSON time format to a UTC time.