bonsai-elasticsearch-rails 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- N2Y1YjZiOTllZDY2MWI2ZWEyMTdkOTgxYWVmZjdkY2E0NmU0ZDdiNw==
5
- data.tar.gz: !binary |-
6
- NjNlMTE4ZTc1YWQ4MGM2OGFmNTIwYjE4Y2IzY2I1ZTgwNDRjMDFiMw==
2
+ SHA1:
3
+ metadata.gz: 3f48a0171a0973f1ef02157d1e92077986a080e6
4
+ data.tar.gz: 02b6d110cfa04774046c2ac8573240883db2d9ba
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YmI0OWEwZTZiYWExMjk5NTRkN2I0ODc1MjljNWU5OTQwYzVhNjhlZGYyNTQy
10
- Y2VhNDg1ODU4M2VhMzQxYWI0YjA5NTM1MWFhODdhZDMzMzk3YWQyMjlmNThk
11
- MGIwMTk0OTBhNDM2MjIzZjcwMzZmYzNlNmQ1N2E1YTY0NWI0Yjg=
12
- data.tar.gz: !binary |-
13
- NDk5ZTExNDhjZWFhYjhjNjMwOTQ4MzBhYzQwNmU2Y2NiODFkZWI5Yzg4ZWU4
14
- N2UwNDI5MmExMzBiNzI4YmRmYWY2M2M5ZTRkZTdiOTJkZjc1ZTNmMTgxODgw
15
- M2Q1ODg1ZjhmOTRkOTk5ZDIzOGI2MTc4NmRkOGIwMzY0NzhkY2Q=
6
+ metadata.gz: 773acedb2d176d60ed96f6313aa3352d2295e7ea87da02d989b11bd241396cb59bedd0b68adc4aeb33c7903d20a3cac41a1e674a648c31e4a963daed41375b7c
7
+ data.tar.gz: 9b7ba251a37ddbee2f3ec8aaf739b258b8614c4c432c51c46227c7179db428849c685b34608bc770eadfb442a5ba96102699bb736f70b0ec35d0ea7f28a636c7
@@ -0,0 +1,13 @@
1
+ require 'elasticsearch/model'
2
+ require 'elasticsearch/rails'
3
+
4
+ Rails.logger = Logger.new(STDOUT) if Rails.logger.nil?
5
+ url = ENV['BONSAI_URL'] || ENV['ELASTICSEARCH_URL']
6
+
7
+ unless url.nil?
8
+ url_safe = url.gsub(/\:[a-z0-9]{1,}@/, ":redacted@")
9
+ Rails.logger.info("Starting up a new Bonsai Elasticsearch client with url: #{url_safe}")
10
+ Elasticsearch::Model.client = Elasticsearch::Client.new url: url
11
+ else
12
+ Rails.logger.warn('Could not find a `BONSAI_URL` environment variable with a cluster URL. The bonsai-elasticsearch-rails can not create an Elasticsearch client. Please contact support at: support@bonsai.io')
13
+ end
metadata CHANGED
@@ -1,73 +1,110 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonsai-elasticsearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Sears
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: elasticsearch-model
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
20
- type: :development
19
+ version: '0'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: elasticsearch-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: elasticsearch-rails
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: Integrate your elasticsearch-rails gem with bonsai.
54
+ version: '1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '11.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "<"
67
+ - !ruby/object:Gem::Version
68
+ version: '11.0'
69
+ description: |2
70
+ This gem offers a shim to connect Rails apps with a Bonsai
71
+ Elasticsearch cluster. The official Elasticsearch gem package
72
+ requires some minor configuration tweaks in order to work
73
+ correctly with Bonsai (namely the client needs to be instantiated
74
+ with the cluster location and HTTP authentication details), and
75
+ the process can be somewhat complicated for users who are
76
+ unfamiliar with the system.
77
+
78
+ The bonsai-elasticsearch-rails gem automatically sets up the
79
+ Elasticsearch client correctly so users don't need to worry about
80
+ configuring it in their code or writing an initializer.
81
+
82
+ In order for the gem to work correctly, the application needs an
83
+ environment variable called `BONSAI_URL`, which is populated with
84
+ the complete Bonsai Elaticsearch cluster URL, including the HTTP
85
+ authentication. The cluster URL will follow this pattern:
86
+
87
+ https://user1234:pass5678@cluster-slug-123.aws-region-X.bonsai.io/
88
+
89
+ On Heroku, this variable is created and populated automatically
90
+ when Bonsai is added to the application. Heroku users therefore do
91
+ not need to perform any additional configuration to connect to
92
+ their cluster after adding the bonsai-elasticsearch-rails gem.
93
+
94
+ Users who are self-hosting their Rails app will need to make sure
95
+ this environment variable is present:
96
+
97
+ export BONSAI_URL="https://user1234:pass5678@aws-region-X.bonsai.io/"
98
+
99
+ The cluster URL is available via the Bonsai dashboard.
56
100
  email:
57
- - rc.sears@gmail.com
101
+ - rob@onemorecloud.com
58
102
  executables: []
59
103
  extensions: []
60
104
  extra_rdoc_files: []
61
105
  files:
62
- - .gitignore
63
- - Gemfile
64
- - LICENSE.txt
65
- - README.md
66
- - Rakefile
67
- - bonsai-elasticsearch-rails.gemspec
68
- - lib/bonsai/elasticsearch/rails.rb
69
- - lib/bonsai/elasticsearch/rails/version.rb
70
- homepage: http://bonsai.io
106
+ - lib/bonsai-elasticsearch-rails.rb
107
+ homepage: https://github.com/omc/bonsai-elasticsearch-rails
71
108
  licenses:
72
109
  - MIT
73
110
  metadata: {}
@@ -77,18 +114,18 @@ require_paths:
77
114
  - lib
78
115
  required_ruby_version: !ruby/object:Gem::Requirement
79
116
  requirements:
80
- - - ! '>='
117
+ - - ">="
81
118
  - !ruby/object:Gem::Version
82
119
  version: '0'
83
120
  required_rubygems_version: !ruby/object:Gem::Requirement
84
121
  requirements:
85
- - - ! '>='
122
+ - - ">="
86
123
  - !ruby/object:Gem::Version
87
124
  version: '0'
88
125
  requirements: []
89
126
  rubyforge_project:
90
- rubygems_version: 2.2.2
127
+ rubygems_version: 2.6.6
91
128
  signing_key:
92
129
  specification_version: 4
93
- summary: Integrate your elasticsearch-rails gem with bonsai.
130
+ summary: Integrate your elasticsearch-rails gem with Bonsai Elasticsearch.
94
131
  test_files: []
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in bonsai-elasticsearch-rails.gemspec
4
- gemspec
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 TODO: Write your name
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,22 +0,0 @@
1
- # Bonsai::Elasticsearch::Rails
2
-
3
- This gem works with the elasticsearch-rails gem to allow users of [bonsai](http://bonsai.io) to more easily integrate their app with bonsai's service.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'bonsai-elasticsearch-rails'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install bonsai-elasticsearch-rails
18
-
19
- ## Usage
20
-
21
- You should not need to do anything special to use the gem. The integration will be performed transparently.
22
-
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,24 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'bonsai/elasticsearch/rails/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "bonsai-elasticsearch-rails"
8
- spec.version = Bonsai::Elasticsearch::Rails::VERSION
9
- spec.authors = ["Rob Sears"]
10
- spec.email = ["rc.sears@gmail.com"]
11
- spec.summary = %q{Integrate your elasticsearch-rails gem with bonsai.}
12
- spec.description = %q{Integrate your elasticsearch-rails gem with bonsai.}
13
- spec.homepage = "http://bonsai.io"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "elasticsearch-rails"
24
- end
@@ -1,4 +0,0 @@
1
- require "bonsai/elasticsearch/rails/version"
2
-
3
- puts "Starting up a new ElasticSearch client with #{ENV['BONSAI_URL']}"
4
- Elasticsearch::Model.client = Elasticsearch::Client.new url: ENV['BONSAI_URL']
@@ -1,7 +0,0 @@
1
- module Bonsai
2
- module Elasticsearch
3
- module Rails
4
- VERSION = "0.0.4"
5
- end
6
- end
7
- end