bson_ext 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +6 -6
- data/ext/cbson/cbson.c +12 -0
- data/ext/cbson/version.h +1 -1
- metadata +13 -6
data/Rakefile
CHANGED
@@ -110,7 +110,7 @@ end
|
|
110
110
|
|
111
111
|
desc "Generate documentation"
|
112
112
|
task :rdoc do
|
113
|
-
version = eval(File.read("mongo
|
113
|
+
version = eval(File.read("mongo.gemspec")).version
|
114
114
|
out = File.join('html', version.to_s)
|
115
115
|
FileUtils.rm_rf('html')
|
116
116
|
system "rdoc --main README.rdoc --op #{out} --inline-source --quiet README.rdoc `find lib -name '*.rb'`"
|
@@ -121,7 +121,7 @@ task :ydoc do
|
|
121
121
|
require File.join(File.dirname(__FILE__), 'lib', 'mongo')
|
122
122
|
out = File.join('ydoc', Mongo::VERSION)
|
123
123
|
FileUtils.rm_rf('ydoc')
|
124
|
-
system "yardoc lib/**/*.rb lib/mongo/**/*.rb -e docs/yard_ext.rb -p docs/templates -o #{out} --title MongoRuby-#{Mongo::VERSION}"
|
124
|
+
system "yardoc lib/**/*.rb lib/mongo/**/*.rb lib/bson/**/*.rb -e docs/yard_ext.rb -p docs/templates -o #{out} --title MongoRuby-#{Mongo::VERSION}"
|
125
125
|
end
|
126
126
|
|
127
127
|
desc "Publish documentation to mongo.rubyforge.org"
|
@@ -134,18 +134,18 @@ namespace :gem do
|
|
134
134
|
|
135
135
|
desc "Install the gem locally"
|
136
136
|
task :install do
|
137
|
-
sh "gem build
|
137
|
+
sh "gem build bson.gemspec"
|
138
|
+
sh "gem install bson-*.gem"
|
139
|
+
sh "gem build mongo.gemspec"
|
138
140
|
sh "gem install mongo-*.gem"
|
139
141
|
sh "rm mongo-*.gem"
|
142
|
+
sh "rm bson-*.gem"
|
140
143
|
end
|
141
144
|
|
142
145
|
desc "Install the optional c extensions"
|
143
146
|
task :install_extensions do
|
144
|
-
sh "gem build bson.gemspec"
|
145
147
|
sh "gem build bson_ext.gemspec"
|
146
|
-
sh "gem install bson-*.gem"
|
147
148
|
sh "gem install bson_ext-*.gem"
|
148
|
-
sh "rm bson-*.gem"
|
149
149
|
sh "rm bson_ext-*.gem"
|
150
150
|
end
|
151
151
|
|
data/ext/cbson/cbson.c
CHANGED
@@ -141,7 +141,11 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
|
|
141
141
|
* and raise an exception if not. */
|
142
142
|
/* TODO maybe we can use something more portable like vsnprintf instead
|
143
143
|
* of this hack. And share it with the Python extension ;) */
|
144
|
+
/* If we don't have ASPRINTF, there are two possibilities:
|
145
|
+
* either use _scprintf and _snprintf on for Windows or
|
146
|
+
* use snprintf for solaris. */
|
144
147
|
#ifndef HAVE_ASPRINTF
|
148
|
+
#ifdef _MSC_VER
|
145
149
|
#define INT2STRING(buffer, i) \
|
146
150
|
{ \
|
147
151
|
int vslength = _scprintf("%d", i) + 1; \
|
@@ -149,6 +153,14 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
|
|
149
153
|
_snprintf(*buffer, vslength, "%d", i); \
|
150
154
|
}
|
151
155
|
#else
|
156
|
+
#define INT2STRING(buffer, i) \
|
157
|
+
{ \
|
158
|
+
int vslength = snprintf(NULL, 0, "%d", i) + 1; \
|
159
|
+
*buffer = malloc(vslength); \
|
160
|
+
snprintf(*buffer, vslength, "%d", i); \
|
161
|
+
}
|
162
|
+
#endif
|
163
|
+
#else
|
152
164
|
#define INT2STRING(buffer, i) asprintf(buffer, "%d", i);
|
153
165
|
#endif
|
154
166
|
|
data/ext/cbson/version.h
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 1.0.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Mike Dirolf
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-07-13 00:00:00 -04:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -32,7 +37,7 @@ files:
|
|
32
37
|
- ext/cbson/buffer.h
|
33
38
|
- ext/cbson/encoding_helpers.h
|
34
39
|
- ext/cbson/version.h
|
35
|
-
has_rdoc:
|
40
|
+
has_rdoc: false
|
36
41
|
homepage: http://www.mongodb.org
|
37
42
|
licenses: []
|
38
43
|
|
@@ -45,18 +50,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
50
|
requirements:
|
46
51
|
- - ">="
|
47
52
|
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
48
55
|
version: "0"
|
49
|
-
version:
|
50
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
60
|
+
segments:
|
61
|
+
- 0
|
54
62
|
version: "0"
|
55
|
-
version:
|
56
63
|
requirements: []
|
57
64
|
|
58
65
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.3.
|
66
|
+
rubygems_version: 1.3.6
|
60
67
|
signing_key:
|
61
68
|
specification_version: 3
|
62
69
|
summary: C extensions for Ruby BSON.
|