orientdb_client 0.0.6 → 0.0.7

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: 03bbffcac337c8b24baa097e7f55f3d4350cea44
4
- data.tar.gz: a2074ddd31091c8aaae2af2fb49f2d94633d370d
3
+ metadata.gz: 8c427444c46d0f4c5beecc6e0f6bfaf47e094dd6
4
+ data.tar.gz: d9573d4f5bca08e707fe550d0d5422e7c686b331
5
5
  SHA512:
6
- metadata.gz: a4191890669fe5a9fe9ff44e986b355adaf9a4c7182783e9d47df3ce9f4ec64d2f4f91a8050544b5509b16d4166a92a9c1cbf7a46af6fbc13103d3a2a03cce8c
7
- data.tar.gz: 896fc166ca48be6faef0729eb14cd4fda54a894460d3270b78389e0a480dcd129b6d06b3c00cb3216c42449b671599aeeef8920bf973eafa06b4d5c5308b29f7
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
@@ -3,8 +3,7 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in orientdb_client.gemspec
4
4
  gemspec
5
5
 
6
- gem 'activesupport', '> 3.2', require: false
7
-
8
6
  group :test do
7
+ gem 'activesupport', '~> 4.0', require: false
9
8
  gem 'curb', '~> 0.8'
10
9
  end
@@ -1,9 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'activesupport', '~> 3.2', require: false
4
-
5
3
  group :test do
6
4
  gem 'curb', '~> 0.8'
5
+ gem 'activesupport', '~> 3.2', require: false
7
6
  end
8
7
 
9
8
  gemspec :path => "../"
@@ -1,9 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'activesupport', '~> 4.0', require: false
4
-
5
3
  group :test do
6
4
  gem 'curb', '~> 0.8'
5
+ gem 'activesupport', '~> 4.0', require: false
7
6
  end
8
7
 
9
8
  gemspec :path => "../"
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :test do
4
+ gem 'curb', '~> 0.8'
5
+ gem 'activesupport', '~> 5.0', require: false
6
+ end
7
+
8
+ gemspec :path => "../"
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 = if block_given?
16
- yield payload
17
- else
18
- nil
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
@@ -1,3 +1,3 @@
1
1
  module OrientdbClient
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -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 = safe_instrument('request.orientdb_client', request_instrumentation_hash) do |payload|
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 = safe_instrument('process_response.orientdb_client', response_instrumentation_hash) do |payload|
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
@@ -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[:error]).to eq('RuntimeError')
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
- expect(memory_instrumenter.events.last.payload[:error]).to eq('OrientdbClient::SerializationException')
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.6
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-01-21 00:00:00.000000000 Z
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: {}