zelastic 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32d5e7e9052a7ebbb7c2cbd634e44b526e1404b6
4
- data.tar.gz: 35e76a4d208277eb3f6860a6653b8893ea969aaa
3
+ metadata.gz: dd3ad1bd811164b7227b243782cea048602ece2c
4
+ data.tar.gz: 6796d5134935589ca86d27601a2eb6d771ae53a7
5
5
  SHA512:
6
- metadata.gz: fc224397b8174c2779939103cecd6fa4151da5e14847961a46258e28aa079631136a89fb29474af53a5d8c6c7173ca5c90df467d133d819fa4174ee2f725698d
7
- data.tar.gz: 9bd14709ce77ca55689209e480021864cd42f1333d3d4d635bd8f8f886e9b7cfbbb6809f1331e83144fd6c91fcde5cca316dfa9baccce32ad6937cde75058110
6
+ metadata.gz: 4569aedd2380a6974ecc467cff030cc75527fc7d5adeec4c347f73595b298f9f21115f012c76a7f2e3ee881613f884139785e9ead50bed86acf2f32db127fbed
7
+ data.tar.gz: fa8a9be28763777a93bf052fa3e53b9ce855c441a9dd4492eebf49e025aa3ed59a631c84e53fc1a9715e6ce1170ed89eaf1acd35c96b83ec74a20ed86606ed14
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zelastic (0.1.0)
4
+ zelastic (0.2.0)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -2,6 +2,15 @@
2
2
 
3
3
  module Zelastic
4
4
  class Indexer
5
+ class IndexingError < StandardError
6
+ attr_reader :errors
7
+
8
+ def initialize(errors)
9
+ @errors = errors
10
+ super("Errors indexing: #{errors.join(', ')}")
11
+ end
12
+ end
13
+
5
14
  extend Forwardable
6
15
 
7
16
  def initialize(config)
@@ -99,7 +108,8 @@ module Zelastic
99
108
  def execute_bulk(commands)
100
109
  result = config.client.bulk(body: commands)
101
110
  return result unless result['errors']
102
- result['items'].map { |item| item['error'] }.compact
111
+ errors = result['items'].map { |item| item['error'] }.compact
112
+ raise IndexingError, errors
103
113
  end
104
114
  end
105
115
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zelastic
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zelastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport