bson 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bson might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/README.md +3 -152
- data/lib/bson/date.rb +2 -0
- data/lib/bson/version.rb +1 -1
- metadata +26 -4
- metadata.gz.sig +2 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 019fdce3d10ee37a06d4981b26ce0a2a9a76fb63
|
4
|
+
data.tar.gz: 79ecfec23aa93cad55213c6c89e2dcb6b84412d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61b0d3b6306b89f6f887a3e56f7ec2f86d1891aa4fed5a7986a96b9a28e5192de8fa619e03ceccecae8c17bb866f938db326f86e704c152bf817253941c2fdb5
|
7
|
+
data.tar.gz: 5d26f6c7d1cb8d507154e2e2ef4ecdee5ddb9e19068f19bd715c30e7097c5d03b5cb8337bb2351ceed5d1f82d2f39d4bad135a58dce3580027ec41f79363bc1c
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,159 +8,10 @@ Compatibility
|
|
8
8
|
|
9
9
|
BSON is tested against MRI (1.9.2+), JRuby (1.7.0+) and Rubinius (2.0.0+).
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
With bundler, add the `bson` gem to your `Gemfile`. As of 2.0.0 native extensions
|
15
|
-
are bundled with the `bson` gem and `bson_ext` is no longer needed.
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
gem "bson", "~> 2.3"
|
19
|
-
```
|
20
|
-
|
21
|
-
Require the `bson` gem in your application.
|
22
|
-
|
23
|
-
```ruby
|
24
|
-
require "bson"
|
25
|
-
```
|
26
|
-
|
27
|
-
Usage
|
28
|
-
-----
|
29
|
-
|
30
|
-
### BSON Serialization
|
31
|
-
|
32
|
-
Getting a Ruby object's raw BSON representation is done by calling `to_bson`
|
33
|
-
on the Ruby object. For example:
|
34
|
-
|
35
|
-
```ruby
|
36
|
-
"Shall I compare thee to a summer's day".to_bson
|
37
|
-
1024.to_bson
|
38
|
-
```
|
39
|
-
|
40
|
-
Generating an object from BSON is done via calling `from_bson` on the class
|
41
|
-
you wish to instantiate and passing it the `StringIO` bytes.
|
42
|
-
|
43
|
-
```ruby
|
44
|
-
String.from_bson(string_io)
|
45
|
-
Int32.from_bson(string_io)
|
46
|
-
```
|
47
|
-
|
48
|
-
Core Ruby object's that have representations in the BSON specification and
|
49
|
-
will have a `to_bson` method defined for them are:
|
50
|
-
|
51
|
-
- `Array`
|
52
|
-
- `FalseClass`
|
53
|
-
- `Float`
|
54
|
-
- `Hash`
|
55
|
-
- `Integer`
|
56
|
-
- `NilClass`
|
57
|
-
- `Regexp`
|
58
|
-
- `String`
|
59
|
-
- `Symbol` (deprecated)
|
60
|
-
- `Time`
|
61
|
-
- `TrueClass`
|
62
|
-
|
63
|
-
In addition to the core Ruby objects, BSON also provides some special types
|
64
|
-
specific to the specification:
|
65
|
-
|
66
|
-
#### `BSON::Binary`
|
67
|
-
|
68
|
-
This is a representation of binary data, and must provide the raw data and
|
69
|
-
a subtype when constructing.
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
BSON::Binary.new(binary_data, :md5)
|
73
|
-
```
|
74
|
-
|
75
|
-
Valid subtypes are: `:generic`, `:function`, `:old`, `:uuid_old`, `:uuid`,
|
76
|
-
`:md5`, `:user`.
|
77
|
-
|
78
|
-
#### `BSON::Code`
|
79
|
-
|
80
|
-
Represents a string of Javascript code.
|
81
|
-
|
82
|
-
```ruby
|
83
|
-
BSON::Code.new("this.value = 5;")
|
84
|
-
```
|
85
|
-
|
86
|
-
#### `BSON::CodeWithScope`
|
87
|
-
|
88
|
-
Represents a string of Javascript code with a hash of values.
|
89
|
-
|
90
|
-
```ruby
|
91
|
-
BSON::CodeWithScope.new("this.value = age;", age: 5)
|
92
|
-
```
|
93
|
-
|
94
|
-
#### `BSON::Document`
|
95
|
-
|
96
|
-
This is a special ordered hash for use with Ruby below 1.9, and is simply
|
97
|
-
a subclass of a Ruby hash in 1.9 and higher.
|
98
|
-
|
99
|
-
```ruby
|
100
|
-
BSON::Document[:key, "value"]
|
101
|
-
BSON::Document.new
|
102
|
-
```
|
103
|
-
|
104
|
-
#### `BSON::MaxKey`
|
105
|
-
|
106
|
-
Represents a value in BSON that will always compare higher to another value.
|
107
|
-
|
108
|
-
```ruby
|
109
|
-
BSON::MaxKey.new
|
110
|
-
```
|
111
|
-
|
112
|
-
#### `BSON::MinKey`
|
113
|
-
|
114
|
-
Represents a value in BSON that will always compare lower to another value.
|
115
|
-
|
116
|
-
```ruby
|
117
|
-
BSON::MinKey.new
|
118
|
-
```
|
119
|
-
|
120
|
-
#### `BSON::ObjectId`
|
121
|
-
|
122
|
-
Represents a 12 byte unique identifier for an object on a given machine.
|
123
|
-
|
124
|
-
```ruby
|
125
|
-
BSON::ObjectId.new
|
126
|
-
```
|
127
|
-
|
128
|
-
#### `BSON::Timestamp`
|
129
|
-
|
130
|
-
Represents a special time with a start and increment value.
|
131
|
-
|
132
|
-
```ruby
|
133
|
-
BSON::Timestamp.new(5, 30)
|
134
|
-
```
|
135
|
-
|
136
|
-
#### `BSON::Undefined`
|
137
|
-
|
138
|
-
Represents a placeholder for a value that was not provided.
|
139
|
-
|
140
|
-
```ruby
|
141
|
-
BSON::Undefined.new
|
142
|
-
```
|
143
|
-
|
144
|
-
### JSON Serialization
|
145
|
-
|
146
|
-
Some BSON types have special representations in JSON. These are as follows
|
147
|
-
and will be automatically serialized in the form when calling `to_json` on
|
148
|
-
them.
|
149
|
-
|
150
|
-
- `BSON::Binary`: `{ "$binary" : "\x01", "$type" : "md5" }`
|
151
|
-
- `BSON::Code`: `{ "$code" : "this.v = 5 }`
|
152
|
-
- `BSON::CodeWithScope`: `{ "$code" : "this.v = value", "$scope" : { v => 5 }}`
|
153
|
-
- `BSON::MaxKey`: `{ "$maxKey" : 1 }`
|
154
|
-
- `BSON::MinKey`: `{ "$minKey" : 1 }`
|
155
|
-
- `BSON::ObjectId`: `{ "$oid" : "4e4d66343b39b68407000001" }`
|
156
|
-
- `BSON::Timestamp`: `{ "t" : 5, "i" : 30 }`
|
157
|
-
- `Regexp`: `{ "$regex" : "[abc]", "$options" : "i" }`
|
158
|
-
|
159
|
-
### Notes on Special Ruby Date Classes
|
11
|
+
Documentation
|
12
|
+
-------------
|
160
13
|
|
161
|
-
|
162
|
-
they are deserialized they will always be returned as a `Time` since the BSON
|
163
|
-
specification only has a `Time` type and knows nothing about Ruby.
|
14
|
+
Current documentation can be found [here](http://docs.mongodb.org/ecosystem/tutorial/ruby-bson-tutorial/#ruby-bson-tutorial)
|
164
15
|
|
165
16
|
API Documentation
|
166
17
|
-----------------
|
data/lib/bson/date.rb
CHANGED
data/lib/bson/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -11,8 +11,30 @@ authors:
|
|
11
11
|
- Gary Murakami
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
|
-
cert_chain:
|
15
|
-
|
14
|
+
cert_chain:
|
15
|
+
- |
|
16
|
+
-----BEGIN CERTIFICATE-----
|
17
|
+
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
|
18
|
+
ZXItcnVieTEVMBMGCgmSJomT8ixkARkWBTEwZ2VuMRMwEQYKCZImiZPyLGQB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Mj0Y39qHdoWYKeCkEoj5UWNcHRK9xgaHJR6prlXrIhgb
|
34
|
+
o2UXDbWtz5PqoFd8EgNJAn3+BG1pwC9S9pVFG3WPucfAx/bE8iq/vvchHei5Y/Vo
|
35
|
+
aAz5f/hY4zFeYWvGDBHYEXE1rTN2hhMSyJscPcFbmz0=
|
36
|
+
-----END CERTIFICATE-----
|
37
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
16
38
|
dependencies: []
|
17
39
|
description: A full featured BSON specification implementation, in Ruby
|
18
40
|
email:
|
@@ -114,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
136
|
version: 1.3.6
|
115
137
|
requirements: []
|
116
138
|
rubyforge_project: bson
|
117
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.4.6
|
118
140
|
signing_key:
|
119
141
|
specification_version: 4
|
120
142
|
summary: Ruby Implementation of the BSON specification
|
metadata.gz.sig
ADDED