mongo_ext 0.15.1 → 0.16

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,9 +14,23 @@ include Config
14
14
  gem_command = "gem"
15
15
  gem_command = "gem1.9" if $0.match(/1\.9$/) # use gem1.9 if we used rake1.9
16
16
 
17
- # NOTE: some of the tests assume Mongo is running
18
- Rake::TestTask.new do |t|
19
- t.test_files = FileList['test/test*.rb']
17
+ # NOTE: the functional tests assume MongoDB is running.
18
+ desc "Test the MongoDB Ruby driver."
19
+ task :test do
20
+ Rake::Task['test:unit'].invoke
21
+ Rake::Task['test:functional'].invoke
22
+ end
23
+
24
+ namespace :test do
25
+ Rake::TestTask.new(:unit) do |t|
26
+ t.test_files = FileList['test/unit/*_test.rb']
27
+ t.verbose = true
28
+ end
29
+
30
+ Rake::TestTask.new(:functional) do |t|
31
+ t.test_files = FileList['test/test*.rb']
32
+ t.verbose = true
33
+ end
20
34
  end
21
35
 
22
36
  desc "Generate documentation"
@@ -438,15 +438,14 @@ static void write_doc(bson_buffer* buffer, VALUE hash, VALUE check_keys) {
438
438
  int length_location = buffer_save_bytes(buffer, 4);
439
439
  int length;
440
440
 
441
- VALUE key = rb_str_new2("_id");
442
- if (rb_funcall(hash, rb_intern("has_key?"), 1, key) == Qtrue) {
443
- VALUE id = rb_hash_aref(hash, key);
444
- write_element_allow_id(key, id, pack_extra(buffer, check_keys), 1);
445
- }
446
- key = ID2SYM(rb_intern("_id"));
447
- if (rb_funcall(hash, rb_intern("has_key?"), 1, key) == Qtrue) {
448
- VALUE id = rb_hash_aref(hash, key);
449
- write_element_allow_id(key, id, pack_extra(buffer, check_keys), 1);
441
+ VALUE id_str = rb_str_new2("_id");
442
+ VALUE id_sym = ID2SYM(rb_intern("_id"));
443
+ if (rb_funcall(hash, rb_intern("has_key?"), 1, id_str) == Qtrue) {
444
+ VALUE id = rb_hash_aref(hash, id_str);
445
+ write_element_allow_id(id_str, id, pack_extra(buffer, check_keys), 1);
446
+ } else if (rb_funcall(hash, rb_intern("has_key?"), 1, id_sym) == Qtrue) {
447
+ VALUE id = rb_hash_aref(hash, id_sym);
448
+ write_element_allow_id(id_sym, id, pack_extra(buffer, check_keys), 1);
450
449
  }
451
450
 
452
451
  // we have to check for an OrderedHash and handle that specially
@@ -1,21 +1,17 @@
1
- # We need to list all of the included files because we aren't allowed to use
2
- # Dir[...] in the github sandbox.
3
- PACKAGE_FILES = ['Rakefile', 'mongo-extensions.gemspec',
4
- 'ext/cbson/cbson.c',
5
- 'ext/cbson/extconf.rb']
6
- TEST_FILES = []
1
+ require 'lib/mongo'
7
2
 
8
3
  Gem::Specification.new do |s|
9
4
  s.name = 'mongo_ext'
10
5
 
11
- s.version = '0.15.1'
6
+ s.version = Mongo::VERSION
12
7
  s.platform = Gem::Platform::RUBY
13
8
  s.summary = 'C extensions for the MongoDB Ruby driver'
14
9
  s.description = 'C extensions to accelerate the MongoDB Ruby driver. For more information about Mongo, see http://www.mongodb.org.'
15
10
 
16
11
  s.require_paths = ['ext']
17
- s.files = PACKAGE_FILES
18
- s.test_files = TEST_FILES
12
+ s.files = ['Rakefile', 'mongo-extensions.gemspec']
13
+ s.files += Dir['ext/**/*.rb'] + Dir['ext/**/*.c']
14
+ s.test_files = []
19
15
 
20
16
  s.has_rdoc = false
21
17
  s.extensions << 'ext/cbson/extconf.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: "0.16"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dirolf
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-08 00:00:00 -04:00
12
+ date: 2009-10-26 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -24,8 +24,8 @@ extra_rdoc_files: []
24
24
  files:
25
25
  - Rakefile
26
26
  - mongo-extensions.gemspec
27
- - ext/cbson/cbson.c
28
27
  - ext/cbson/extconf.rb
28
+ - ext/cbson/cbson.c
29
29
  has_rdoc: true
30
30
  homepage: http://www.mongodb.org
31
31
  licenses: []