orientdb_client 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6ff9bea3763a8ec608f82345d72cf055701c520
4
- data.tar.gz: f87c97ac3b85eee009e16c28694c5ddbcad9af49
3
+ metadata.gz: 3810979454170f1b6d1df18f2f453bfad734f500
4
+ data.tar.gz: f49bf1b2472ada3244ddd7c34ba66c368f0d15a9
5
5
  SHA512:
6
- metadata.gz: 4be54bafd6bbab818aa34f4f29b73468e620bd07a5c93bd32dc3e6c92d8d9dcd75b03644dbe4a5649a04544fc494113c35def34dadff55a8f4a3327e5ae215fb
7
- data.tar.gz: 4028fbaa72f17074eff9a2588cc9f44a9824e6f0f94eda236984abcc8f55b1ad67c6354f8d91803c6a6d88723e96924b5a5e2d3ab47e25619e86d48ddd760671
6
+ metadata.gz: 6629eb4fc5d56be1d4a1a5d306fd7aaaf56942d41a0636a784271c612636c40b8e71c5fc2e5bbeec0c980c94b5ad07577f4b37aaf7d28cd7cb4e6d36f197d300
7
+ data.tar.gz: 2f29920d54e52bf12c1c752f6974cb694587ddf317e197c0ed1fd32540487131b1075e1c87f43d07f0fcbe2796fc53a53627d0578ea7bfba22d7d9369c31e2e5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 0.0.9
6
+
7
+ * Fixes for orientdb 2.2.30 compatibility
8
+
5
9
  ## 0.0.8
6
10
 
7
11
  * Fix circular argument warning.
data/README.md CHANGED
@@ -12,6 +12,7 @@ Goals:
12
12
  * fine-grained handling of Orientdb errors, via rich set of ruby exceptions
13
13
 
14
14
  Tested on:
15
+ * 2.2.30
15
16
  * 2.2.10
16
17
  * 2.1.10
17
18
  * 2.1.9
@@ -359,7 +359,7 @@ module OrientdbClient
359
359
  when /NegativeArraySizeException/
360
360
  raise NegativeArraySizeException.new("#{odb_error_class}: #{odb_error_message}", code, body)
361
361
  else
362
- raise ServerError.new("Unparseable Orientdb server error", code, body)
362
+ error_handling_fallback(code, body)
363
363
  end
364
364
  end
365
365
 
@@ -372,12 +372,16 @@ module OrientdbClient
372
372
  rescue => e
373
373
  code = response.response_code
374
374
  body = response.body
375
+ error_handling_fallback(code, body, e)
376
+ end
377
+
378
+ def error_handling_fallback(code, body, e = nil)
375
379
  if (body.match(/Database.*already exists/))
376
380
  raise ConflictError.new('Database already exists', code, body)
377
381
  elsif (body.match(/NegativeArraySizeException/))
378
382
  raise NegativeArraySizeException.new(e.message, code, body)
379
383
  else
380
- raise OrientdbError.new("Could not parse Orientdb server error: #{code}, #{body}")
384
+ raise ServerError.new("Unparseable Orientdb server error", code, body)
381
385
  end
382
386
  end
383
387
 
@@ -1,3 +1,3 @@
1
1
  module OrientdbClient
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -385,6 +385,12 @@ RSpec.describe OrientdbClient do
385
385
 
386
386
  # This spec sometimes fails on Orientdb 2.1.X
387
387
  context 'when class does not exist' do
388
+ before do
389
+ if (client.has_class?(class_name))
390
+ client.drop_class(class_name)
391
+ end
392
+ end
393
+
388
394
  it 'raises exception' do
389
395
  expect do
390
396
  client.create_property(class_name, 'member_name', 'string')
@@ -691,9 +697,20 @@ RSpec.describe OrientdbClient do
691
697
  jim_rid = jim['result'][0]['@rid']
692
698
  bob_rid = bob['result'][0]['@rid']
693
699
  client.command("create edge Friend from #{jim_rid} to #{bob_rid}")
694
- expect do
695
- client.query("select in('Friend')[660-669].user_id,user_id from Person where user_id in [2]", {:limit=>1})
696
- end.to raise_exception(OrientdbClient::NotFoundError)
700
+
701
+ err = nil
702
+
703
+ begin
704
+ result = client.query("select in('Friend')[660-669].user_id,user_id from Person where user_id in [2]", {:limit=>1})
705
+ rescue => e
706
+ err = e
707
+ end
708
+
709
+ if err
710
+ expect(err).to be_a(OrientdbClient::NotFoundError)
711
+ else
712
+ expect(result[0]['in']).to eql([])
713
+ end
697
714
  end
698
715
  end
699
716
 
@@ -711,7 +728,7 @@ RSpec.describe OrientdbClient do
711
728
  end
712
729
 
713
730
  it 'raises DuplicateRecordError' do
714
- error_klass = $distributed_mode ? OrientdbClient::DistributedDuplicateRecordError : OrientdbClient:: DuplicateRecordError
731
+ error_klass = $distributed_mode ? OrientdbClient::DistributedDuplicateRecordError : OrientdbClient::DuplicateRecordError
715
732
  client.create_class('Person', extends: 'V') do |c|
716
733
  c.property('user_id', 'integer')
717
734
  end
@@ -839,6 +856,9 @@ RSpec.describe OrientdbClient do
839
856
  else
840
857
  correct_error_raised = err.is_a?(OrientdbClient::MVCCError)
841
858
  end
859
+ if !err
860
+ pending 'could not produce mvcc conflict (consistently fails with orientdb 2.2.30)'
861
+ end
842
862
  expect(correct_error_raised).to be true
843
863
  end
844
864
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orientdb_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Rodgers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-13 00:00:00.000000000 Z
11
+ date: 2018-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.2.2
185
+ rubygems_version: 2.6.11
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Orientdb ruby client