bonsai-elasticsearch-rails 0.2.0 → 0.3.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: fe04901a601b65d48908d1dd20fe2af94533dc25
4
- data.tar.gz: 1bd87fbd2a8bb7bb19f176b2f613ae1b4ec2c7ec
3
+ metadata.gz: 4a5bc3b05cb6368466916ed1771e52ac3970df8d
4
+ data.tar.gz: e5d48c65ab23c3049e8201a6ef82a82bbbe31065
5
5
  SHA512:
6
- metadata.gz: bfee26a39ef0a57ea98c367dabea99f73552348856cd4270ce1966c5e5aa35a3546dcb4dc47c428b02a14df7032cec74e37de56ddfe5564b7b24cbf458d043e9
7
- data.tar.gz: ba496d5cfe65ada972689e98dbc7809480f8b7dbe5b24750405ee2ba310395b58d2562604325efeea7a7fff1389155e79a3d2ff45270ed3bd5c02017487f359c
6
+ metadata.gz: 9092535510a230df09dfc770a944c6ab2d7f88d0aa15fc49311ff7cf86a540414b14ac9709229b682012a212ebf68e99e86f4c614fca4ec2a15968254da0c9fe
7
+ data.tar.gz: b595b1580dea6304b3d6f1ce77f6edac3c2e70e2796edd19524ddbfc18855fbadd7cc9dda33f133e32e9b09ab30a92de88b84055b3f3f5f7edfd2ef26388ea78
@@ -1,3 +1,4 @@
1
1
  if defined?(Rails)
2
- require File.expand_path('bonsai/elasticsearch/rails/railtie', File.dirname(__FILE__))
2
+ require File.expand_path('bonsai/elasticsearch/rails/railtie',
3
+ File.dirname(__FILE__))
3
4
  end
@@ -1,10 +1,9 @@
1
1
  module Bonsai
2
2
  module Elasticsearch
3
3
  module Rails
4
+ # Use Railties
4
5
  class Railtie < ::Rails::Railtie
5
-
6
6
  config.after_initialize do
7
-
8
7
  require 'elasticsearch/model'
9
8
  require 'elasticsearch/rails'
10
9
 
@@ -13,19 +12,20 @@ module Bonsai
13
12
 
14
13
  begin
15
14
  if url && URI.parse(url)
16
- filtered_url = url.sub(%r{:[^:@]+@}, ':FILTERED@')
17
- logger.debug("Bonsai: Initializing default Elasticsearch client with #{filtered_url}")
15
+ filtered_url = url.sub(/:[^:@]+@/, ':FILTERED@')
16
+ logger.debug('Bonsai: Initializing default Elasticsearch client'\
17
+ " with #{filtered_url}")
18
18
  ::Elasticsearch::Model.client = ::Elasticsearch::Client.new(
19
19
  url: url
20
20
  )
21
21
  elsif ::Rails.env.production?
22
- logger.debug("BONSAI_URL not present, proceeding with Elasticsearch defaults.")
22
+ logger.debug('BONSAI_URL not present, proceeding with'\
23
+ 'Elasticsearch defaults.')
23
24
  end
24
25
  rescue URI::InvalidURIError => e
25
26
  logger.error("Elasticsearch cluster URL is invalid: #{e.message}")
26
27
  end
27
28
  end
28
-
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonsai-elasticsearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Sears
@@ -9,36 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-27 00:00:00.000000000 Z
12
+ date: 2018-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: elasticsearch-model
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
+ - - "~>"
22
+ - !ruby/object:Gem::Version
23
+ version: '5'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">"
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: elasticsearch-rails
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
- - - "~>"
38
+ - - ">"
33
39
  - !ruby/object:Gem::Version
34
40
  version: '0'
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '5'
35
44
  type: :runtime
36
45
  prerelease: false
37
46
  version_requirements: !ruby/object:Gem::Requirement
38
47
  requirements:
39
- - - "~>"
48
+ - - ">"
40
49
  - !ruby/object:Gem::Version
41
50
  version: '0'
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '5'
42
54
  - !ruby/object:Gem::Dependency
43
55
  name: bundler
44
56
  requirement: !ruby/object:Gem::Requirement
@@ -68,36 +80,36 @@ dependencies:
68
80
  - !ruby/object:Gem::Version
69
81
  version: '11.0'
70
82
  description: |2
71
- This gem offers a shim to connect Rails apps with a Bonsai
72
- Elasticsearch cluster. The official Elasticsearch gem package
73
- requires some minor configuration tweaks in order to work
74
- correctly with Bonsai (namely the client needs to be instantiated
75
- with the cluster location and HTTP authentication details), and
76
- the process can be somewhat complicated for users who are
77
- unfamiliar with the system.
83
+ This gem offers a shim to connect Rails apps with a Bonsai
84
+ Elasticsearch cluster. The official Elasticsearch gem package
85
+ requires some minor configuration tweaks in order to work
86
+ correctly with Bonsai (namely the client needs to be instantiated
87
+ with the cluster location and HTTP authentication details), and
88
+ the process can be somewhat complicated for users who are
89
+ unfamiliar with the system.
78
90
 
79
- The bonsai-elasticsearch-rails gem automatically sets up the
80
- Elasticsearch client correctly so users don't need to worry about
81
- configuring it in their code or writing an initializer.
91
+ The bonsai-elasticsearch-rails gem automatically sets up the
92
+ Elasticsearch client correctly so users don't need to worry about
93
+ configuring it in their code or writing an initializer.
82
94
 
83
- In order for the gem to work correctly, the application needs an
84
- environment variable called `BONSAI_URL`, which is populated with
85
- the complete Bonsai Elaticsearch cluster URL, including the HTTP
86
- authentication. The cluster URL will follow this pattern:
95
+ In order for the gem to work correctly, the application needs an
96
+ environment variable called `BONSAI_URL`, which is populated with
97
+ the complete Bonsai Elaticsearch cluster URL, including the HTTP
98
+ authentication. The cluster URL will follow this pattern:
87
99
 
88
- https://user1234:pass5678@cluster-slug-123.aws-region-X.bonsai.io/
100
+ https://user1234:pass5678@cluster-slug-123.aws-region-X.bonsai.io/
89
101
 
90
- On Heroku, this variable is created and populated automatically
91
- when Bonsai is added to the application. Heroku users therefore do
92
- not need to perform any additional configuration to connect to
93
- their cluster after adding the bonsai-elasticsearch-rails gem.
102
+ On Heroku, this variable is created and populated automatically
103
+ when Bonsai is added to the application. Heroku users therefore do
104
+ not need to perform any additional configuration to connect to
105
+ their cluster after adding the bonsai-elasticsearch-rails gem.
94
106
 
95
- Users who are self-hosting their Rails app will need to make sure
96
- this environment variable is present:
107
+ Users who are self-hosting their Rails app will need to make sure
108
+ this environment variable is present:
97
109
 
98
- export BONSAI_URL="https://user1234:pass5678@aws-region-X.bonsai.io/"
110
+ export BONSAI_URL="https://user1234:pass5678@aws-region-X.bonsai.io/"
99
111
 
100
- The cluster URL is available via the Bonsai dashboard.
112
+ The cluster URL is available via the Bonsai dashboard.
101
113
  email:
102
114
  - rob@onemorecloud.com
103
115
  - nick@onemorecloud.com
@@ -127,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
139
  version: '0'
128
140
  requirements: []
129
141
  rubyforge_project:
130
- rubygems_version: 2.6.6
142
+ rubygems_version: 2.5.2
131
143
  signing_key:
132
144
  specification_version: 4
133
- summary: Integrate your elasticsearch-rails gem with Bonsai Elasticsearch.
145
+ summary: Initialize your Elasticsearch client with Bonsai.
134
146
  test_files: []