Skip to content
This repository was archived by the owner on Jan 9, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .rvmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
rvm jruby-head@jmongo --create
export JRUBY_OPTS="--1.9"
rvm jruby-1.7.0@jmongo --create

2 changes: 1 addition & 1 deletion lib/jmongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
require 'java'

require 'require_all'
require_rel 'jmongo/*.jar'
require_rel 'jmongo/mongo-2.10.0.jar'

require_rel 'jmongo/**/*.rb'

10 changes: 4 additions & 6 deletions lib/jmongo/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,25 @@ def initialize host = nil, port = nil, opts = {}
@mongo_uri = opts[:new_from_uri]
@options = @mongo_uri.options
@write_concern = @options.write_concern
@connection = JMongo::Mongo.new(@mongo_uri)
@connection = JMongo::MongoClient.new(@mongo_uri)
else
@host = host || 'localhost'
@port = port || 27017
@server_address = JMongo::ServerAddress.new @host, @port
@options = JMongo::MongoOptions.new
@options = JMongo::MongoClientOptions::Builder.new
opts.each do |k,v|
key = k.to_sym
jmo_key = JMongo.options_ruby2java_lu(key)
case jmo_key
when :safe
@write_concern = DB.write_concern(v)
@options.w = @write_concern.w
@options.wtimeout = @write_concern.wtimeout
@options.fsync = @write_concern.fsync
@options.write_concern @write_concern
else
jmo_val = JMongo.options_ruby2java_xf(key, v)
@options.send("#{jmo_key}=", jmo_val)
end
end
@connection = JMongo::Mongo.new(@server_address, @options)
@connection = JMongo::MongoClient.new(@server_address, @options.build)
end
@connector = @connection.connector
add = @connector.address
Expand Down
1 change: 0 additions & 1 deletion lib/jmongo/cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ def spawn_cursor
@j_cursor = @j_cursor.addOption JMongo::Bytes::QUERYOPTION_NOTIMEOUT unless @timeout
@j_cursor = @j_cursor.addOption JMongo::Bytes::QUERYOPTION_TAILABLE if @tailable
end

self
end

Expand Down
Binary file added lib/jmongo/mongo-2.10.0.jar
Binary file not shown.
Binary file removed lib/jmongo/mongo-2.6.5.gb1.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/jmongo/mongo/jmongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module JMongo
java_import com.mongodb.DBCollection
java_import com.mongodb.DBCursor
java_import com.mongodb.DBObject
java_import com.mongodb.Mongo
java_import com.mongodb.MongoOptions
java_import com.mongodb.MongoClient
java_import com.mongodb.MongoClientOptions
java_import com.mongodb.ServerAddress
java_import com.mongodb.WriteConcern
java_import com.mongodb.WriteResult
Expand Down