Closed ayosec closed 13 years ago
I cherry picked 04eb6ec, but am concerned about 23b5323 because of pull request 31. 31 really helps in loading large documents.
I put together my own pull request from christophstrum's patches that I believe fixes #25. Could you have a look at 32?
PR #32 works well on JRuby. There are still some little issues (in this pull request too), but at least it is usable.
Thanks!
The commit 23b53235 uses
pack("c*")
to transform the read data before to send it toBSON::BSON_CODER.deserialize
.In MRI all the tests pass.
With JRuby 1.5.1 I had to remove the
bson_ext
dependency, since it doesn't work with old JRuby. IMO, theem-mongo
gem should not depend directly onbson_ext
. With MongoID thebson_ext
is optional, so the application can decide use it or not.After remove
bson_ext
, all test passed with JRuby 1.5.1With JRuby 1.6.4 the
bson_ext
can be used, but there is a failed test. After some debugging it seems that the problem is not related toem-mongo
(maybe a bug in thebson
gem, or even a problem compiling JRuby).You can see the results for JRuby 1.6.4
The problem is only related adding a regular expression to a document. If I remove the line with the regex all the tests pass with no errors. I will try to detect the origin of the error, but at least the
em-mongo
can be used with JRuby.There is another commit, which fixes the use of
Dir.tmpdir
. This method returns the generic tmp directory (at least on Linux), so it should not be used as the database path for MongoDB. The fix is not related with JRuby, but it is necessary to run the tests on any platform where the/tmp/
is accessed by other processes.