Browse files

added support for server_version

  • Loading branch information...
1 parent 5623451 commit 277014b063ebbe9190567bb1caf9aa0896676d0b @guyboertje committed May 18, 2011
Showing with 12 additions and 12 deletions.
  1. 0 bin/jmongo
  2. +2 −0 jmongo.gemspec
  3. +2 −10 lib/jmongo.rb
  4. +7 −0 lib/jmongo/ajrb.rb
  5. +1 −1 lib/jmongo/connection.rb
  6. +0 −1 lib/jmongo/cursor.rb
View
0 bin/jmongo 100644 → 100755
File mode changed.
View
2 jmongo.gemspec
@@ -30,8 +30,10 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<bones>, [">= 3.4.1"])
else
s.add_dependency(%q<bones>, [">= 3.4.1"])
+ s.add_dependency "jrjackson"
end
else
s.add_dependency(%q<bones>, [">= 3.4.1"])
+ s.add_dependency "jrjackson"
end
end
View
12 lib/jmongo.rb
@@ -85,18 +85,10 @@ def self.require_all_jars_relative_to( fname, dir = nil )
require_all_file_extensions_relative_to( fname, 'jar', dir )
end
+end # module Mongo
- module Utils
-
- def raise_not_implemented
- raise NoMethodError, "This method hasn't been implemented yet."
- end
-
- private
-
- end # module Utils
+require 'jrjackson'
-end # module Mongo
if defined?(JrJackson)
JSON = JrJackson::Json
end
View
7 lib/jmongo/ajrb.rb
@@ -19,6 +19,9 @@ def get_db_names
def drop_a_db(name)
@connection.drop_database(name)
end
+ def _server_version
+ @connection.get_version
+ end
end
module Db_
@@ -96,6 +99,10 @@ def save_document(obj, safe)
end
module Utils
+ def raise_not_implemented
+ raise NoMethodError, "This method hasn't been implemented yet."
+ end
+
def to_dbobject obj
case obj
when Array
View
2 lib/jmongo/connection.rb
@@ -165,7 +165,7 @@ def server_info
# @return [Mongo::ServerVersion]
# object allowing easy comparability of version.
def server_version
- raise_not_implemented
+ _server_version
end
# Is it okay to connect to a slave?
View
1 lib/jmongo/cursor.rb
@@ -15,7 +15,6 @@
module Mongo
class Cursor
- include Mongo::Utils
include Mongo::JavaImpl::Utils
attr_reader :j_cursor

0 comments on commit 277014b

Please sign in to comment.