common_indexer 0.3.3 → 0.3.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
  SHA1:
3
- metadata.gz: cea67e29ca40474b04e30a1e8ec01597d142c7d9
4
- data.tar.gz: 135e9a4372aaf56b23c5afde220d8943c8b5114a
3
+ metadata.gz: f4c04288510a31222bf983bceb65b31f66e5d95d
4
+ data.tar.gz: cb7eafeef3b091eb6db73afdae1f0b90e9037852
5
5
  SHA512:
6
- metadata.gz: a96754a460b219e7f50425e8fab3b18ade0881f6fbc8e5c5cdbec2b66fc3c288371aebbea8dc2cdf297e6281758299f582e7f9403f13edd30b1311a8739ca019
7
- data.tar.gz: 68b3111e720c34e4d50cccaed0ac8ce07053482eac4db18bdbec64d3fe6c7a77bca6ea520c7af7ab0806a64899288c7127ef2889280bc99bd256a95d8def999c
6
+ metadata.gz: 41412f4df6230e21a54dbd3654c06662a14c760188fe65e2f1f7a5d519e150c271273dd075ca6b66022ab0f27387ffe762f0a667afc458776f6bb34d3163804c
7
+ data.tar.gz: 7d0c782d6c6a048a4daaf38c6bcbf68382d208275881c83747a2fa73a46d0a90a737522f704d6db472c061e839087952fda04e35a6207a5f81ab78858df9da05
data/README.md CHANGED
@@ -40,6 +40,19 @@ Add an initializer to configure the CommonIndexer gem with the app settings:
40
40
  end
41
41
  ```
42
42
 
43
+ You can pass in additional configuration if needed. Ex:
44
+
45
+ ```ruby
46
+ CommonIndexer.configure_client do |f|
47
+ f.request :aws_sigv4,
48
+ service: service,
49
+ region: region,
50
+ access_key_id: ENV['AWS_ACCESS_KEY_ID'],
51
+ secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
52
+ session_token: ENV['AWS_SESSION_TOKEN'] # optional
53
+ end
54
+ ```
55
+
43
56
  ## Usage
44
57
 
45
58
  Include the CommonIndexer into your model that you want to index with `include ::CommonIndexer::Base`, and define a `#to_common_index` method in that model. `#to_common_index` should return a hash with metadata key/values that conform to the common index mapping.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommonIndexer
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  end
@@ -25,6 +25,10 @@ module CommonIndexer # :nodoc:
25
25
  @client ||= Elasticsearch::Client.new(hosts: config.endpoint)
26
26
  end
27
27
 
28
+ def configure_client(&block)
29
+ @client = Elasticsearch::Client.new(hosts: config.endpoint, &block)
30
+ end
31
+
28
32
  def configure_index!
29
33
  new_index = [index_name, Time.now.utc.strftime('%Y%m%d%H%M%S%3N')].join('_')
30
34
  client.indices.create(index: new_index)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-28 00:00:00.000000000 Z
12
+ date: 2019-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active-fedora