mongo 0.17 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,11 @@ If (or once) you have Gemcutter setup, install the "mongo" gem by typing
32
32
 
33
33
  $ gem install mongo
34
34
 
35
+ For a significant performance boost, you should also install the driver's C
36
+ extensions:
37
+
38
+ $ gem install mongo_ext
39
+
35
40
  === From the GitHub source
36
41
 
37
42
  The source code is available at http://github.com/mongodb/mongo-ruby-driver.
@@ -41,15 +46,7 @@ you can install it as a gem from the source by typing
41
46
 
42
47
  $ rake gem:install
43
48
 
44
- === Optional C Extension
45
-
46
- There is a separate gem containing optional C extensions that will increase the
47
- performance of the driver. To use the optional extensions just install the gem
48
- by typing
49
-
50
- $ gem install mongo_ext
51
-
52
- To install from source type this instead
49
+ To install the C extensions from source, type this instead:
53
50
 
54
51
  $ rake gem:install_extensions
55
52
 
@@ -358,6 +355,7 @@ Sean Cribbs, seancribbs on github
358
355
 
359
356
  Sunny Hirai
360
357
  * Suggested hashcode fix for Mongo::ObjectID
358
+ * Noted index ordering bug.
361
359
 
362
360
  = License
363
361
 
@@ -23,11 +23,13 @@ begin
23
23
  BSON_SERIALIZER = CBson
24
24
  rescue LoadError
25
25
  BSON_SERIALIZER = BSON
26
+ warn "\n**Notice: C extension not detected. This is required for optimum MongoDB Ruby driver performance."
27
+ warn " You can install the extension as follows:\n gem install mongo_ext\n"
26
28
  end
27
29
 
28
30
  module Mongo
29
31
  ASCENDING = 1
30
32
  DESCENDING = -1
31
33
 
32
- VERSION = "0.17"
34
+ VERSION = "0.17.1"
33
35
  end
@@ -505,4 +505,5 @@ EOS
505
505
  indexes.join("_")
506
506
  end
507
507
  end
508
+
508
509
  end
@@ -14,8 +14,6 @@
14
14
  # limitations under the License.
15
15
  # ++
16
16
 
17
- require 'mongo/db'
18
-
19
17
  module Mongo
20
18
 
21
19
  # A connection to MongoDB.
@@ -422,7 +422,7 @@ module Mongo
422
422
  sel = {:ns => full_collection_name(collection_name)}
423
423
  info = {}
424
424
  Cursor.new(Collection.new(self, SYSTEM_INDEX_COLLECTION), :selector => sel).each { |index|
425
- info[index['name']] = index['key'].to_a
425
+ info[index['name']] = index['key'].map
426
426
  }
427
427
  info
428
428
  end
@@ -69,6 +69,7 @@ class OrderedHash < Hash
69
69
  @ordered_keys.each { |k| yield k, self[k] }
70
70
  self
71
71
  end
72
+ alias :each_pair :each
72
73
 
73
74
  def values
74
75
  collect { |k, v| v }
@@ -398,4 +398,27 @@ class TestCollection < Test::Unit::TestCase
398
398
  assert_equal 1, @collection.size
399
399
  end
400
400
  end
401
+
402
+ context "Creating indexes " do
403
+ setup do
404
+ @collection = @@db.collection('test-collection')
405
+ end
406
+
407
+ should "generate indexes in the proper order" do
408
+ @collection.expects(:insert_documents) do |sel, coll, safe|
409
+ assert_equal 'b_1_a_1', sel[:name]
410
+ end
411
+ @collection.create_index([['b', 1], ['a', 1]])
412
+ end
413
+
414
+ context "with an index created" do
415
+ setup do
416
+ @collection.create_index([['b', 1], ['a', 1]])
417
+ end
418
+
419
+ should "return properly ordered index information" do
420
+ assert_equal [['b', 1], ['a', 1]], @collection.index_information["b_1_a_1"]
421
+ end
422
+ end
423
+ end
401
424
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.17"
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Menard
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-16 00:00:00 -05:00
13
+ date: 2009-11-17 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies: []
16
16