orientdb_client 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -2
- data/Gemfiles/Gemfile.as3.2 +1 -2
- data/Gemfiles/Gemfile.as4.0 +1 -2
- data/Gemfiles/Gemfile.as5.0 +8 -0
- data/README.md +2 -0
- data/lib/orientdb_client/instrumenters/memory.rb +9 -7
- data/lib/orientdb_client/version.rb +1 -1
- data/lib/orientdb_client.rb +2 -17
- data/orientdb_client.gemspec +1 -1
- data/spec/orientdb_client_spec.rb +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c427444c46d0f4c5beecc6e0f6bfaf47e094dd6
|
4
|
+
data.tar.gz: d9573d4f5bca08e707fe550d0d5422e7c686b331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f99c6bf186824a78c8c4817f3562fac61c362110cb93b8d296d20dbc3d7a9867c697aa3559202d3a8c3d03468d50c405bc300b4147c0b2c6d7a08da06d1e9e
|
7
|
+
data.tar.gz: eb0a3d64d9594d05559fcd836c7773573f1a061b05e114b3629fb1d231af979364cfbb481a29968360e1ee4a5c0110b329f91174d9998209ff417ff7b453df86
|
data/.travis.yml
CHANGED
@@ -2,6 +2,7 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 2.1
|
4
4
|
- 2.2
|
5
|
+
- 2.3.1
|
5
6
|
script: bundle exec rspec --tag ~'type:integration'
|
6
7
|
matrix:
|
7
8
|
include:
|
@@ -9,3 +10,5 @@ matrix:
|
|
9
10
|
gemfile: Gemfiles/Gemfile.as3.2
|
10
11
|
- rvm: 2.2
|
11
12
|
gemfile: Gemfiles/Gemfile.as4.0
|
13
|
+
- rvm: 2.3.1
|
14
|
+
gemfile: Gemfiles/Gemfile.as5.0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
+
## 0.0.7
|
6
|
+
|
7
|
+
* Test ActiveSupport 5 and ruby 2.3.1.
|
8
|
+
* Delete redundant `safely_instrument` code -- this is already done by ActiveSupport. This will be a breaking change for code that expects errors in the ASN payload to be in the `error` key.
|
9
|
+
They will now be in the `exception` key, as an array.
|
10
|
+
|
5
11
|
## 0.0.6
|
6
12
|
|
7
13
|
* Correctly handle error message for database creation conflict exceptions.
|
data/Gemfile
CHANGED
data/Gemfiles/Gemfile.as3.2
CHANGED
data/Gemfiles/Gemfile.as4.0
CHANGED
data/README.md
CHANGED
@@ -12,6 +12,8 @@ Goals:
|
|
12
12
|
* fine-grained handling of Orientdb errors, via rich set of ruby exceptions
|
13
13
|
|
14
14
|
Tested on:
|
15
|
+
* 2.1.10
|
16
|
+
* 2.1.9
|
15
17
|
* 2.1.5
|
16
18
|
* 2.1.4
|
17
19
|
* 2.0.6 - specs may fail due to Orientdb bug with deleting database (https://github.com/orientechnologies/orientdb/issues/3746)
|
@@ -12,14 +12,16 @@ module OrientdbClient
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def instrument(name, payload = {})
|
15
|
-
result =
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
result = nil
|
16
|
+
begin
|
17
|
+
result = yield payload
|
18
|
+
rescue Exception => e
|
19
|
+
payload[:exception] = [e.class.name, e.message]
|
20
|
+
raise e
|
21
|
+
ensure
|
22
|
+
@events << Event.new(name, payload, result)
|
23
|
+
result
|
19
24
|
end
|
20
|
-
|
21
|
-
@events << Event.new(name, payload, result)
|
22
|
-
result
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
data/lib/orientdb_client.rb
CHANGED
@@ -253,13 +253,13 @@ module OrientdbClient
|
|
253
253
|
def request(method, path, options = {})
|
254
254
|
url = build_url(path)
|
255
255
|
request_instrumentation_hash = {method: method, url: url, options: options}
|
256
|
-
raw_response =
|
256
|
+
raw_response = @client.instrument('request.orientdb_client', request_instrumentation_hash) do |payload|
|
257
257
|
response = @http_client.request(method, url, options)
|
258
258
|
payload[:response_code] = response.response_code
|
259
259
|
response
|
260
260
|
end
|
261
261
|
response_instrumentation_hash = request_instrumentation_hash.merge(response_code: raw_response.response_code)
|
262
|
-
processed_response =
|
262
|
+
processed_response = @client.instrument('process_response.orientdb_client', response_instrumentation_hash) do |payload|
|
263
263
|
handle_response(raw_response)
|
264
264
|
end
|
265
265
|
processed_response
|
@@ -392,20 +392,5 @@ module OrientdbClient
|
|
392
392
|
raise OrientdbError.new("Could not parse Orientdb server error", response.response_code, response.body)
|
393
393
|
end
|
394
394
|
end
|
395
|
-
|
396
|
-
# Ensures instrumentation will complete even if exception is raised.
|
397
|
-
def safe_instrument(event_name, args)
|
398
|
-
err = nil
|
399
|
-
result = @client.instrument(event_name, args) do |payload|
|
400
|
-
begin
|
401
|
-
yield payload
|
402
|
-
rescue => e
|
403
|
-
payload[:error] = e.class.to_s
|
404
|
-
err = e
|
405
|
-
end
|
406
|
-
end
|
407
|
-
raise err if err
|
408
|
-
result
|
409
|
-
end
|
410
395
|
end
|
411
396
|
end
|
data/orientdb_client.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["lukeasrodgers@gmail.com"]
|
11
11
|
spec.summary = %q{Orientdb ruby client}
|
12
12
|
spec.description = %q{Orientdb ruby client aiming to be simple, fast, and provide good integration with Orientdb error messages.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/lukeasrodgers/orientdb_client"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -753,7 +753,7 @@ RSpec.describe OrientdbClient do
|
|
753
753
|
client.get_class('OUser')
|
754
754
|
rescue
|
755
755
|
ensure
|
756
|
-
expect(memory_instrumenter.events.last.payload[:
|
756
|
+
expect(memory_instrumenter.events.last.payload[:exception]).to eq(['RuntimeError', 'err'])
|
757
757
|
end
|
758
758
|
end
|
759
759
|
|
@@ -776,7 +776,8 @@ RSpec.describe OrientdbClient do
|
|
776
776
|
client.command('insert into OUser CONTENT ' + Oj.dump({a:1}))
|
777
777
|
rescue
|
778
778
|
ensure
|
779
|
-
|
779
|
+
exception_klass = memory_instrumenter.events.last.payload[:exception].first
|
780
|
+
expect(exception_klass).to eq('OrientdbClient::SerializationException')
|
780
781
|
end
|
781
782
|
end
|
782
783
|
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.
|
4
|
+
version: 0.0.7
|
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-
|
11
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- Gemfile
|
138
138
|
- Gemfiles/Gemfile.as3.2
|
139
139
|
- Gemfiles/Gemfile.as4.0
|
140
|
+
- Gemfiles/Gemfile.as5.0
|
140
141
|
- LICENSE.txt
|
141
142
|
- README.md
|
142
143
|
- Rakefile
|
@@ -158,7 +159,7 @@ files:
|
|
158
159
|
- spec/spec_helper.rb
|
159
160
|
- spec/support/shared_examples_for_http_adapter.rb
|
160
161
|
- spec/typhoeus_adapter_spec.rb
|
161
|
-
homepage:
|
162
|
+
homepage: https://github.com/lukeasrodgers/orientdb_client
|
162
163
|
licenses:
|
163
164
|
- MIT
|
164
165
|
metadata: {}
|