create_custom_attributes 0.5.23 → 0.5.24

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: 3116f92a168ab1d124c5bbf6c8fd1226291f1969
4
- data.tar.gz: a579b89c34f3563af99247cb60d6b738d7b5d1f0
3
+ metadata.gz: 05a8198fbc2cce5bbbd6f04e176b7185fcfb0076
4
+ data.tar.gz: 4af787babaaea1d564c7238b7e8669772153ecd1
5
5
  SHA512:
6
- metadata.gz: c1128e995802e6629d894e0f22bb4092d148cc7809b747887edf7bafa01b5855823f0eefe18d9896fdc74c61a7db48a4df5808dd14e853998a5961486c8ce231
7
- data.tar.gz: 63398f39caeef362bcad56e0e1e07946a90d6450e7ffdf2ba66e6356342ee37044706f8bd05d0eca57afbf5e9e57423352d90c11390093c26cf2f146f0b68c7d
6
+ metadata.gz: 2cd13b036d2ce5280b34d75590592df4bbf3351364f2a5b6e933e43a1b84ebd10c04f44962324f9512949bb15f7867414538b7668e0574de9efbdea83f8b3685
7
+ data.tar.gz: 949c544b636f033e569a215d4396139310fdcf2483deb573f837b650dd3c8211aea2372714a4cd858d960856956c2083cb82b09a140f06cb98689d2620bd2a10
@@ -28,7 +28,7 @@ module CustomAttributes
28
28
  @config = {
29
29
  search_user: ENV["ELASTICSEARCH_USER"] || 'elastic',
30
30
  search_pass: ENV["ELASTICSEARCH_PASSWORD"] || 'changeme',
31
- search_host: ENV["ELASTICSEARCH_HOST"] || 'localhost:9200',
31
+ search_host: ENV["ELASTICSEARCH_HOST"] || 'http://localhost:9200',
32
32
  search_index_prefix: ENV["ELASTICSEARCH_INDEX_PREFIX"] || 'es'
33
33
  }
34
34
 
@@ -47,6 +47,16 @@ module CustomAttributes
47
47
 
48
48
  def self.after_configuration
49
49
  # Set up ElasticSearch
50
- Elasticsearch::Model.client = Elasticsearch::Client.new host: "http://#{@config[:search_user]}:#{@config[:search_pass]}@#{@config[:search_host]}"
50
+ uri = URI(@config[:search_host])
51
+
52
+ if @config[:search_user].present? && @config[:search_pass].present?
53
+ host = "#{uri.scheme}://#{@config[:search_user]}:#{@config[:search_pass]}@#{uri.host}"
54
+ else
55
+ host = uri.host
56
+ end
57
+
58
+ host = "#{host}:#{uri.port}" if uri.port.present?
59
+
60
+ Elasticsearch::Model.client = Elasticsearch::Client.new host: host
51
61
  end
52
62
  end
@@ -1,3 +1,3 @@
1
1
  module CustomAttributes
2
- VERSION = '0.5.23'.freeze
2
+ VERSION = '0.5.24'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_custom_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.23
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Grützmacher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails