neuromancer-indexer 0.4.3 → 0.4.4

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
  SHA256:
3
- metadata.gz: d6a6aa1fb4617947d57aa646fdee3d7592b82e1a89aa93045d39cd909a3930bc
4
- data.tar.gz: 21c05252da0be42dae9555b28652c0555e6f33a5418239e9f71fdfe8bf6d7453
3
+ metadata.gz: 923187d8ea912f966d2bfc1c323fdb736706867359b7adc17466a220ee7e50fc
4
+ data.tar.gz: 3b8f4cf05967b285d7ed583c06abcb1d596fa3e0cb2e384441c04756f896cd3c
5
5
  SHA512:
6
- metadata.gz: 96c343e7e04475ba35d9a09c0f90ebdf46bad91ef76693f1e0abca954860b74466f989fdfc69e4a4f6cd63073fc35b8a6fc136d1892dab3a5080707753e56cf7
7
- data.tar.gz: 0fbd0a58e46f336f3a9bd11708a6a4e7e1191b4ecb91f7412881d9be00aef5de1b5caf576c2968f0061a24ff7ebde440c8802793b3784210937cafe7a5b808eb
6
+ metadata.gz: aaabed6b75d852e09f27b0e032291adb90727585b22a698f1af8a3512e6aa6c34720a9684b5c2f64bd57e45be461e0c44e1069057dd38190a0f7362b34829957
7
+ data.tar.gz: afd1756604eb10e42d1a8004217a150477dc85d93b9793911868293dfc483ab4e5312de4484d7e5544eda282b66e28b2d726e3de17e30375d670c1f8f4f6be5c
@@ -22,6 +22,17 @@ jobs:
22
22
  gem install bundler
23
23
  bundle install
24
24
 
25
+ - name: Push to GitHub Package Repository
26
+ run: |
27
+ mkdir -p $HOME/.gem
28
+ touch $HOME/.gem/credentials
29
+ chmod 0600 $HOME/.gem/credentials
30
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
31
+ gem build *.gemspec
32
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
33
+ env:
34
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
35
+ OWNER: ${{ github.repository_owner }}
25
36
 
26
37
  - name: Push to RubyGems
27
38
  run: |
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
2
 
3
+ #### 0.4.4
4
+ - [fix] rename `obj.body` to `obj.attributes`
5
+
3
6
  #### 0.4.3
4
7
  - add `Neuromancer::Indexer.delete`
5
8
  - add GitHub workflows for `RSpec`, `Rubocop` and `RubyGems`
data/README.md CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  [![GitHub Actions Test Status](https://github.com/jdahlke/neuromancer-indexer/workflows/Tests/badge.svg?branch=develop)](https://github.com/jdahlke/neuromancer-indexer/actions)
4
4
 
5
- Ruby gem to push data for indexing to the Neuromancer service
5
+ Ruby gem to push data for indexing to the Neuromancer service.
6
6
 
7
- ### Configuration and Usage
7
+
8
+ ### Getting started
9
+
10
+ Configuration
8
11
 
9
12
  ```
10
13
  Neuromancer::Indexer.configure do |config|
@@ -15,19 +18,32 @@ Neuromancer::Indexer.configure do |config|
15
18
  config.access_key_id = 'AWS_ACCESS_KEY_ID'
16
19
  config.secret_access_key = 'AWS_SECRET_ACCESS_KEY'
17
20
  end
21
+ ```
18
22
 
19
- Neuromancer::Indexer.index({
23
+ Indexing objects
24
+
25
+ ```
26
+ Neuromancer::Indexer.index(
20
27
  id: 'id-1',
21
28
  type: 'objects',
22
- body: {
29
+ attributes: {
23
30
  foo: 'foo-string',
24
31
  bar: 123,
25
32
  baz: ['abc', 'def']
26
33
  }
27
- })
34
+ )
35
+ ```
36
+
37
+ Deleting objects
38
+
39
+ ```
40
+ Neuromancer::Indexer.delete(
41
+ id: 'id-1',
42
+ type: 'objects'
43
+ )
28
44
  ```
29
45
 
30
- Stubbing in specs
46
+ Stubbing in Specs
31
47
 
32
48
  ```
33
49
  RSpec.configure do |config|
@@ -49,5 +65,5 @@ gem 'neuromancer-indexer'
49
65
  ### Test
50
66
 
51
67
  ```
52
- bundle exec rake spec
68
+ bundle exec rspec spec
53
69
  ```
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neuromancer-indexer (0.4.3)
4
+ neuromancer-indexer (0.4.4)
5
5
  aws-sdk-sqs
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  ast (2.4.1)
11
11
  aws-eventstream (1.1.0)
12
- aws-partitions (1.353.0)
12
+ aws-partitions (1.354.0)
13
13
  aws-sdk-core (3.104.3)
14
14
  aws-eventstream (~> 1, >= 1.0.2)
15
15
  aws-partitions (~> 1, >= 1.239.0)
@@ -10,15 +10,15 @@ module Neuromancer
10
10
  @sqs = sqs
11
11
  end
12
12
 
13
- def index(id:, type:, body:)
14
- document = Document.new(id: id, type: type, body: body)
13
+ def index(id:, type:, attributes:)
14
+ document = Document.new(id: id, type: type, attributes: attributes)
15
15
  document.validate!
16
16
 
17
17
  enqueue(action: 'index', document: document)
18
18
  end
19
19
 
20
20
  def delete(id:, type:)
21
- document = Document.new(id: id, type: type, body: {})
21
+ document = Document.new(id: id, type: type, attributes: {})
22
22
  document.validate!
23
23
 
24
24
  enqueue(action: 'delete', document: document)
@@ -3,19 +3,19 @@
3
3
  module Neuromancer
4
4
  module Indexer
5
5
  class Document
6
- attr_reader :id, :type, :body
6
+ attr_reader :id, :type, :attributes
7
7
 
8
8
  def initialize(attributes)
9
9
  @id = indifferent_value(attributes, :id).to_s
10
10
  @type = indifferent_value(attributes, :type).to_s
11
- @body = indifferent_value(attributes, :body)
11
+ @attributes = indifferent_value(attributes, :attributes)
12
12
  end
13
13
 
14
14
  def as_json
15
15
  {
16
16
  id: id,
17
17
  type: type,
18
- body: body
18
+ attributes: attributes
19
19
  }
20
20
  end
21
21
 
@@ -24,7 +24,7 @@ module Neuromancer
24
24
 
25
25
  errors << 'document#id is empty' if id.empty?
26
26
  errors << 'document#type is empty' if type.empty?
27
- errors << 'document#body is not a Hash' unless body.is_a?(Hash)
27
+ errors << 'document#attributes is not a Hash' unless attributes.is_a?(Hash)
28
28
 
29
29
  raise(InvalidDocument, errors) unless errors.empty?
30
30
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neuromancer
4
4
  module Indexer
5
- VERSION = '0.4.3'
5
+ VERSION = '0.4.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neuromancer-indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joergen Dahlke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs