orientdb-binary 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +27 -0
- data/lib/orientdb_binary.rb +1 -0
- data/lib/orientdb_binary/config.rb +1 -1
- data/lib/orientdb_binary/parser/deserializer.rb +1 -0
- data/lib/orientdb_binary/record_id.rb +38 -0
- data/test/database/test_deserializer.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 483a460ffe7adabe38fcdc83ccabf71c76b3381e
|
4
|
+
data.tar.gz: e5ae7de8051cd0aff177aa923c849f054dbb4fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa2d9e79d8f4849af773e273dc1498c6f1e0b1d0d2d893afffa0d8d3dfdb919574bd4461dd3a659fc7f79da09758df2b027cee16abdec3faae7b2b0caced534
|
7
|
+
data.tar.gz: 5777ffec8ad36e4812b0ad5db63c230933d78d0be82a55443bd17de43afb9a36b7ae630581305c57a3cde3510bc3414c5197b05d245eb7030982fef2cdc89cf2
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
orientdb-binary (0.7.0)
|
5
|
+
bindata (~> 1.8)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
bindata (1.8.2)
|
11
|
+
docile (1.1.2)
|
12
|
+
multi_json (1.8.4)
|
13
|
+
rake (0.9.6)
|
14
|
+
simplecov (0.8.2)
|
15
|
+
docile (~> 1.1.0)
|
16
|
+
multi_json
|
17
|
+
simplecov-html (~> 0.8.0)
|
18
|
+
simplecov-html (0.8.0)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
bundler (~> 1.5)
|
25
|
+
orientdb-binary!
|
26
|
+
rake (~> 0.9)
|
27
|
+
simplecov (~> 0.8)
|
data/lib/orientdb_binary.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Orientdb
|
2
|
+
class RecordId
|
3
|
+
attr_accessor :cluster, :position
|
4
|
+
|
5
|
+
alias_method :eql?, :==
|
6
|
+
|
7
|
+
def initialize(rid=nil)
|
8
|
+
@cluster = nil
|
9
|
+
@position = nil
|
10
|
+
if rid.is_a? String and not rid.empty?
|
11
|
+
parse_rid(rid)
|
12
|
+
elsif rid.is_a? Orientdb::RecordId
|
13
|
+
@cluster = rid.cluster
|
14
|
+
@position = rid.position
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def parse_rid(rid)
|
19
|
+
match = rid.match(/^[#]?(?<cluster>-?\d+):(?<position>\d+)$/)
|
20
|
+
@cluster = match[:cluster].to_i
|
21
|
+
@position = match[:position].to_i
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_s
|
26
|
+
"##{cluster}:#{position}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def temporary?
|
30
|
+
@cluster < 0
|
31
|
+
end
|
32
|
+
|
33
|
+
def ==(o)
|
34
|
+
o.class == self.class && o.cluster == self.cluster && o.position == self.position
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orientdb-binary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Ostrowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
77
|
- Gemfile
|
78
|
+
- Gemfile.lock
|
78
79
|
- LICENSE.txt
|
79
80
|
- README.md
|
80
81
|
- Rakefile
|
@@ -123,6 +124,7 @@ files:
|
|
123
124
|
- lib/orientdb_binary/protocols/record_load.rb
|
124
125
|
- lib/orientdb_binary/protocols/record_update.rb
|
125
126
|
- lib/orientdb_binary/protocols/shutdown.rb
|
127
|
+
- lib/orientdb_binary/record_id.rb
|
126
128
|
- lib/orientdb_binary/server.rb
|
127
129
|
- orientdb-binary.gemspec
|
128
130
|
- test/database/test_database.rb
|