From 2b7739a2572b618a77939c1cebdbe39ffa8eb464 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Fri, 4 Mar 2011 16:51:12 -0500 Subject: [PATCH] RUBY-244 issue serializing Time in array --- ext/java/jar/jbson.jar | Bin 13848 -> 13877 bytes ext/java/src/org/jbson/RubyBSONEncoder.java | 3 +++ test/bson/bson_test.rb | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/java/jar/jbson.jar b/ext/java/jar/jbson.jar index 972f2e89073b70346e56930f3679dc9bb852f980..ffcc70f57db5ab596dd3f87a13428c0531c37395 100644 GIT binary patch delta 9163 zcmY+KRZtuXlZBBmI0SbH65N7Ja1tcA1RdPn28SSnlK}$3U4y&3yF&)|!QCN9kiB)+k(I@K@dRKIq0eJS=0_SmWl$ZrS{(Ee%lF!NY!A>@CDyfQb7wE!{UPCl#G-uq*l zE0;?bLh>E)uQSISz}PCl#HSfVe{VY`y}7eWo{~Tfs&^$hIiG+}bc_+hyxe zp_ zl4AX|*XP2}yKM>z*>Ex8^4Ci{A0B>&`D&-3=6g>=H(W2TX%9tC`ek+=iV0}q_qUZ- zS*G#{{_eDlK~>N$<6%pu{YClLeup9)6VxPU16KN~;o?8fa0~v@Gf`J;#~9qRpUqq{ zai#=`&s|yxiR}krd|e8gQn(J{;~HI5-~@$;lK{G=FO!uazDp=FTWnVk+CrU2{R{fw zs2j+S*P?AF^Cx$k^`EgDqbupKC*`yah3lkf2>7#L=V`yEKA5sIJ?4CqroejxN^@|Z zi^;etBlIG-^P)2pV=x^8@#ulxlbAecQ@s{$Zy11i);IfAb{=qTUJmWm<*uSt6W1YJM(lVOyz=x!33!zhTblsNk<%O;u~2uU@~=@U)H6xGAtwA{YU z&Mb>c7H8(wuFZi4JctxKeiEFydc~eF*oT>m$H|&!nklc(7x!hPTDwS%B%@4G_Ln>P zb`WN`zZu#w0yZMK(8sS50CMx;_-VDAOxgnuLfx|f=nGmim4cmaElFTD{w$UDL;lYaOPB7ps7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PJPYVn3J7+ z-XU<6@(yi(%W}QfsHv#si1E%AF^bW;6-T)#Mb(0D^s&`|zj-z%4p>$y(Dz8IjYw z=4N~cJ1gZQwkNpsw#+Fpy0j8$jsmyOe-L~3Y%{FhkX3nr*3f#l>8Qxc<72ftMNYsX zW${WlR3Q1NSL-mIYfAtFkNflF`b3b$QEdhfL0B(Ca>+(VjJ%wkdMb7bZJ{?wp;w+~ z;PIE4&h5a&Ez6q#P@nHf*iL?I8=l`(-yx2+d@g6%6VAtz*}C+1Wc<199oc8pn$lSl zME?&Db0Q{m{_xHMNNg_RU6NtDXskq+b=}*G(&n;Q$40?8@nW^HOk;eFH#axEL7(j2 zE1@=%p=K=j7J4e~rW-Y7=7AE6-ur}IEuInKR7*)%{+L1hpy6>f7q9(}Ehv$_%)CZh zwQMdsQbUsv0V4=`sc~{uS~9^pmV36Tkb6m}iCI*V94tuEIvfNE*h*t*sHy zY|UuXj6Jq2OJT$mY-$gTnirZNM(>kgmmDS1UhsHrp<%ExmuzlDd|y}AG5Pe;P=5-O zB>TV=MB-usA_@zRPX4S>GL|$^vlGUf0_Q;7*5pD^qhK6wShm2JtljdFOhCIThOc2i z6M9%ES2IigWF!?Yluko7nh3c=D!7*#BpvQ+CQ~L_`l_s zM06e=^8ZxgDl^Jv?eF&(N9vKbmkEclP&^e~laeg6w|| m{L5|=>v&lI5BLAQ&HwH>!uk(45fvLPk&G7;A)EU@g#Q8@RkqLo diff --git a/ext/java/src/org/jbson/RubyBSONEncoder.java b/ext/java/src/org/jbson/RubyBSONEncoder.java index 9e1a8e2..51263f2 100644 --- a/ext/java/src/org/jbson/RubyBSONEncoder.java +++ b/ext/java/src/org/jbson/RubyBSONEncoder.java @@ -281,6 +281,9 @@ public class RubyBSONEncoder extends BSONEncoder { else if ( val instanceof Iterable) putIterable( name , (Iterable)val ); + else if ( val instanceof Date ) + putDate( name , ((Date)val).getTime() ); + else if ( val instanceof byte[] ) putBinary( name , (byte[])val ); diff --git a/test/bson/bson_test.rb b/test/bson/bson_test.rb index 7bcf2aa..b610e3b 100644 --- a/test/bson/bson_test.rb +++ b/test/bson/bson_test.rb @@ -246,8 +246,14 @@ class BSONTest < Test::Unit::TestCase assert_in_delta doc['date'], doc2['date'], 0.001 end + def test_date_in_array + doc = {'date' => [Time.now.utc]} + bson = @encoder.serialize(doc) + doc2 = @encoder.deserialize(bson) + end + def test_date_returns_as_utc - doc = {'date' => Time.now} + doc = {'date' => Time.now.utc} bson = @encoder.serialize(doc) doc2 = @encoder.deserialize(bson) assert doc2['date'].utc?