orientdb4r 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/Gemfile +3 -0
- data/README.rdoc +3 -2
- data/changelog.txt +14 -0
- data/lib/orientdb4r/rest/client.rb +1 -1
- data/lib/orientdb4r/rest/restclient_node.rb +5 -0
- data/lib/orientdb4r/version.rb +4 -3
- data/orientdb4r.gemspec +3 -1
- data/test/readme_sample.rb +1 -0
- data/test/test_client.rb +1 -2
- data/test/test_database.rb +2 -1
- data/test/test_ddo.rb +1 -0
- data/test/test_dmo.rb +1 -0
- data/test/test_document_crud.rb +6 -4
- data/test/test_loadbalancing.rb +1 -0
- data/test/test_utils.rb +1 -0
- metadata +26 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78703fba706afeb8f80d874c8f5e32833a15839f
|
4
|
+
data.tar.gz: 70276305878920f38e2c926e4e7d58e02fea36e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1731ef1553df6b55cab52710a09c1bde1cd429406715799175695bb9079c4cfd2d0786618c8eeaa00d10048569eb369fc5a85f85755b79d54513acdec72af0b2
|
7
|
+
data.tar.gz: 945fc1b08151705c3b0020edcb93449d78fe0d94e965c4dd4a1592777b0997b06864116b44056aafede80f97e277ccdf73bcd19ed0cec3909eb6544da647f0ac
|
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/README.rdoc
CHANGED
@@ -87,13 +87,14 @@ see Wiki page for more sample at https://github.com/veny/orientdb4r/wiki
|
|
87
87
|
* Ruby 1.9.x+
|
88
88
|
* OrientDB 1.0.x-1.3.x for *v0.3.x*
|
89
89
|
* OrientDB 1.4.0+ for *v0.4.x*
|
90
|
+
* OrientDB 1.6.0+ for *v0.5.x*
|
90
91
|
|
91
92
|
== TESTS
|
92
93
|
|
93
94
|
|
94
95
|
> cd /path/to/repository
|
95
|
-
> rake db:setup4test # to create the temp DB which doesn't seem to be a default since v1.5
|
96
|
-
> rake test
|
96
|
+
> bundle exec rake db:setup4test # to create the temp DB which doesn't seem to be a default since v1.5
|
97
|
+
> bundle exec rake test
|
97
98
|
|
98
99
|
Make sure before starting the tests:
|
99
100
|
* database server is running on localhost:2480
|
data/changelog.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
0.5.0 2015-03-02
|
2
|
+
- Provides fixes to be fully compatible with OrientDb v2.x.
|
3
|
+
- No more backward compatible with OrientDb v1.5.x and lesser.
|
4
|
+
- Pull Request #31 : rest-client 1.6.7 => 1.7.x
|
5
|
+
- Pull Request #32 : Add Gemfile & rake as a dev dependency
|
6
|
+
- Pull Request #33 : Fix content type header for rest-client
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
0.4.1 2013-09-03
|
11
|
+
- Enhancement #24 : read-only property
|
12
|
+
- Enhancement #26 : type of new database
|
13
|
+
- Enhancement #27 : license in gemspec
|
14
|
+
|
1
15
|
0.4.0 2013-08-14
|
2
16
|
- Closes gap between this driver and OrientDb v1.4.0+ which introduced some changes on REST API (connect & create_document).
|
3
17
|
- No more backward compatible with OrientDb v1.3.x and lesser.
|
@@ -152,7 +152,7 @@ module Orientdb4r
|
|
152
152
|
:user => :optional, :password => :optional
|
153
153
|
}
|
154
154
|
verify_and_sanitize_options(options, options_pattern)
|
155
|
-
verify_options(options.select {|k,v| k === :storage or k === :type}, {:storage => [:memory, :
|
155
|
+
verify_options(options.select {|k,v| k === :storage or k === :type}, {:storage => [:memory, :plocal], :type => [:document, :graph]})
|
156
156
|
|
157
157
|
params = { :method => :post, :uri => "database/#{options[:database]}/#{options[:storage].to_s}/#{options[:type].to_s}" }
|
158
158
|
params[:no_session] = true # out of existing session which represents an already done authentication
|
@@ -18,6 +18,11 @@ module Orientdb4r
|
|
18
18
|
opts[:url] = "#{url}/#{opts[:uri]}"
|
19
19
|
opts.delete :uri
|
20
20
|
|
21
|
+
if content_type = opts.delete(:content_type)
|
22
|
+
opts[:headers] ||= {}
|
23
|
+
opts[:headers][:content_type] = content_type
|
24
|
+
end
|
25
|
+
|
21
26
|
# data
|
22
27
|
data = opts.delete :data
|
23
28
|
data = '' if data.nil? and :post == opts[:method] # POST has to have data
|
data/lib/orientdb4r/version.rb
CHANGED
@@ -2,10 +2,11 @@ module Orientdb4r
|
|
2
2
|
|
3
3
|
# Version history.
|
4
4
|
VERSION_HISTORY = [
|
5
|
-
['0.
|
5
|
+
['0.5.0', '2015-03-03', "Compatible with OrientDB v2.x, PR #31, PR #32, PR #33"],
|
6
|
+
['0.4.1', '2013-09-03', "Enh #24, Enh #26, Enh #27"],
|
6
7
|
['0.4.0', '2013-08-14', "Closed gap between this driver and OrientDB v1.4.0+; Enh #20, BF #25"],
|
7
|
-
['0.3.3', '2012-12-16', "Enh #18
|
8
|
-
['0.3.2', '2012-11-02', "Enh #13
|
8
|
+
['0.3.3', '2012-12-16', "Enh #18, Enh #19"],
|
9
|
+
['0.3.2', '2012-11-02', "Enh #13, Enh #16"],
|
9
10
|
['0.3.1', '2012-08-27', "Timeout for reuse of dirty nodes in load balancing; BF #14, BF #15"],
|
10
11
|
['0.3.0', '2012-08-01', "Added support for cluster of distributed servers + load balancing"],
|
11
12
|
['0.2.10', '2012-07-21', "Experimental support for Excon HTTP library with Keep-Alive connection"],
|
data/orientdb4r.gemspec
CHANGED
@@ -30,7 +30,9 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.summary = %q{Ruby binding for Orient DB.}
|
31
31
|
s.license = 'Apache License, v2.0'
|
32
32
|
|
33
|
-
s.add_dependency(%q<rest-client>, ["~> 1.
|
33
|
+
s.add_dependency(%q<rest-client>, ["~> 1.7"])
|
34
|
+
|
35
|
+
s.add_development_dependency "rake", "~> 10.3"
|
34
36
|
# s.add_development_dependency(%q<json>, ["~> 1.5.1"])
|
35
37
|
|
36
38
|
end
|
data/test/readme_sample.rb
CHANGED
data/test/test_client.rb
CHANGED
data/test/test_database.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'test/unit'
|
2
|
+
$: << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
|
2
3
|
require 'orientdb4r'
|
3
4
|
|
4
5
|
###
|
@@ -95,7 +96,7 @@ class TestDatabase < Test::Unit::TestCase
|
|
95
96
|
|
96
97
|
# create non-default DB: storage=local;type=graph
|
97
98
|
assert_nothing_thrown do
|
98
|
-
@client.create_database :database => 'UniT', :user => 'root', :password => 'root', :storage => :
|
99
|
+
@client.create_database :database => 'UniT', :user => 'root', :password => 'root', :storage => :plocal, :type => :graph
|
99
100
|
@client.delete_database :database => 'UniT', :user => 'root', :password => 'root'
|
100
101
|
end
|
101
102
|
end
|
data/test/test_ddo.rb
CHANGED
data/test/test_dmo.rb
CHANGED
data/test/test_document_crud.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'test/unit'
|
2
|
+
$: << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
|
2
3
|
require 'orientdb4r'
|
3
4
|
|
4
5
|
###
|
@@ -36,11 +37,12 @@ class TestDocumentCrud < Test::Unit::TestCase
|
|
36
37
|
assert_not_nil doc.doc_rid
|
37
38
|
assert_instance_of Orientdb4r::Rid, doc.doc_rid
|
38
39
|
assert_equal CLASS, doc.doc_class
|
39
|
-
|
40
|
+
assert doc.doc_version >= 1 # https://github.com/orientechnologies/orientdb/issues/3656
|
40
41
|
|
41
42
|
# no effect if a define the version
|
42
|
-
doc = @client.create_document({ '@class' => CLASS, '@version' => 2, 'prop1' => 1, 'prop2' => 'text' })
|
43
|
-
|
43
|
+
# doc = @client.create_document({ '@class' => CLASS, '@version' => 2, 'prop1' => 1, 'prop2' => 'text' })
|
44
|
+
# OrientDB bug https://github.com/orientechnologies/orientdb/issues/3657
|
45
|
+
# assert_equal 0, doc.doc_version
|
44
46
|
|
45
47
|
# no effect if an unknown class
|
46
48
|
doc = @client.create_document({ '@class' => 'unknown_class', 'a' => 11, 'b' => 'text1' })
|
@@ -72,7 +74,7 @@ class TestDocumentCrud < Test::Unit::TestCase
|
|
72
74
|
doc = @client.get_document created.doc_rid
|
73
75
|
assert_equal CLASS, doc.doc_class
|
74
76
|
assert_equal created.doc_rid, doc.doc_rid
|
75
|
-
|
77
|
+
assert doc.doc_version >= 1 # https://github.com/orientechnologies/orientdb/issues/3657
|
76
78
|
assert_equal 'd', doc.doc_type
|
77
79
|
assert_equal 1, doc['prop1']
|
78
80
|
assert_equal 'text', doc['prop2']
|
data/test/test_loadbalancing.rb
CHANGED
data/test/test_utils.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orientdb4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vaclav Sykora
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.3'
|
27
41
|
description: Orientdb4r provides a simple interface on top of OrientDB's RESTful HTTP
|
28
42
|
API.
|
29
43
|
email: vaclav.sykora@gmail.com
|
@@ -33,7 +47,8 @@ extra_rdoc_files:
|
|
33
47
|
- LICENSE
|
34
48
|
- README.rdoc
|
35
49
|
files:
|
36
|
-
- .gitignore
|
50
|
+
- ".gitignore"
|
51
|
+
- Gemfile
|
37
52
|
- LICENSE
|
38
53
|
- README.rdoc
|
39
54
|
- Rakefile
|
@@ -76,22 +91,22 @@ licenses:
|
|
76
91
|
metadata: {}
|
77
92
|
post_install_message:
|
78
93
|
rdoc_options:
|
79
|
-
- --charset=UTF-8
|
94
|
+
- "--charset=UTF-8"
|
80
95
|
require_paths:
|
81
96
|
- lib
|
82
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
98
|
requirements:
|
84
|
-
- -
|
99
|
+
- - ">="
|
85
100
|
- !ruby/object:Gem::Version
|
86
101
|
version: '0'
|
87
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
103
|
requirements:
|
89
|
-
- -
|
104
|
+
- - ">"
|
90
105
|
- !ruby/object:Gem::Version
|
91
106
|
version: 1.3.1
|
92
107
|
requirements: []
|
93
108
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.2.2
|
95
110
|
signing_key:
|
96
111
|
specification_version: 4
|
97
112
|
summary: Ruby binding for Orient DB.
|