gitlab-elasticsearch-git 1.0.1 → 1.0.2

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: 69245382e85329466c42b0f9747ac527a01e2473
4
- data.tar.gz: fdb37b7cb8f67913253cb8d45f790974eea961cc
3
+ metadata.gz: e809a9160b2028a663c05b3b90f64600ffd8f586
4
+ data.tar.gz: 299cb60d6f23e70f4970e1aef248acf3d95e6416
5
5
  SHA512:
6
- metadata.gz: 86f3d459d93084c0293cebbf200484ef4d292753843a321869fd886d9748e57ce218ed9e12d42a1144e9e523244f08c6c41056176a030f8200b2c880904f451f
7
- data.tar.gz: 8c304bef1477625c30e1d1abf95dc3c309b798ebfe6fab90ecae13029f85dfde8e5c6d75fc899be5fc09bfb676972c9af7dfd5bff9a6d1ba87cb0df0cc2b9b44
6
+ metadata.gz: 45defe4936e8c8de624174cc9aadcc25e46b1f6bccc95d37f267e2b7b617c3704c7756b4c539f7e6e6f232d9505edf066d899885350dfb702ae8e0890427bf90
7
+ data.tar.gz: 7af8adfc3a1912e441f2018946e171f63c5c76291f706dd230d8693c93a6132b5b3dda21bd1c5d2e5ad24d6d6f8924e465299041cf8a34c78babbdb281f4b291
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 1.0.2
2
+ - Cache commit's author and committer when indexing a commit
3
+
1
4
  1.0.1
2
5
  - Yield current batch and total count when indexing
3
6
 
@@ -217,6 +217,9 @@ module Elasticsearch
217
217
  end
218
218
 
219
219
  def index_commit(commit)
220
+ author = commit.author
221
+ committer = commit.committer
222
+
220
223
  {
221
224
  index: {
222
225
  _index: "#{self.class.index_name}",
@@ -229,14 +232,14 @@ module Elasticsearch
229
232
  rid: repository_id,
230
233
  sha: commit.oid,
231
234
  author: {
232
- name: encode!(commit.author[:name]),
233
- email: encode!(commit.author[:email]),
234
- time: commit.author[:time].strftime('%Y%m%dT%H%M%S%z'),
235
+ name: encode!(author[:name]),
236
+ email: encode!(author[:email]),
237
+ time: author[:time].strftime('%Y%m%dT%H%M%S%z'),
235
238
  },
236
239
  committer: {
237
- name: encode!(commit.committer[:name]),
238
- email: encode!(commit.committer[:email]),
239
- time: commit.committer[:time].strftime('%Y%m%dT%H%M%S%z'),
240
+ name: encode!(committer[:name]),
241
+ email: encode!(committer[:email]),
242
+ time: committer[:time].strftime('%Y%m%dT%H%M%S%z'),
240
243
  },
241
244
  message: encode!(commit.message)
242
245
  }
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Git
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-elasticsearch-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kumanyaev
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-09 00:00:00.000000000 Z
13
+ date: 2016-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: elasticsearch-model