waistband 0.16.2 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +11 -0
- data/Gemfile +4 -1
- data/README.md +72 -1
- data/lib/waistband/errors.rb +11 -0
- data/lib/waistband/index.rb +58 -3
- data/lib/waistband/version.rb +1 -1
- data/spec/config/waistband/waistband_events_with_env_permissions.yml +27 -0
- data/spec/config/waistband/waistband_events_with_permissions.yml +21 -0
- data/spec/config/waistband/waistband_no_mappings.yml +8 -0
- data/spec/config/waistband/waistband_search.yml +1 -1
- data/spec/lib/body_size_logging_spec.rb +1 -1
- data/spec/lib/{index_spec.rb → index/index_spec.rb} +16 -8
- data/spec/lib/index/permissions_spec.rb +81 -0
- data/spec/lib/index/type_spec.rb +15 -0
- data/spec/lib/index_multi_connection_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -1
- data/spec/support/fake_log.rb +1 -0
- metadata +15 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmI3ZDUzZTFhN2VlODQxMTVlNWRlMDQxNDBhMjlmY2E1MWI1YjQ0MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjdkNTI0OWQyODAzZGM5ZGMxOTZhOTE5OWIwZDA3ODRhOTY2ZDk2Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTkzMmRkY2Y1NDU3MjkzYmY1NjU3Y2VlNGI0ZjI4YjA4ZTAwODMwZmM4ZDBj
|
10
|
+
YjE4ODNjMWE2NzBmMzFkZmZmN2Y0NTQwYmUwOTkxNmNlY2UxMzc0YzljZmM2
|
11
|
+
NmU2ZDI2OTNlZjllZTRlZDBkN2UxZjBmY2EwNTJhNDk5NDAyN2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Yzc4MWZkNWFhZDZhMGY4NWVjODQ1NTBjNGE2ODU0ODgyN2RiNGI3ZWEwYTBl
|
14
|
+
ZjQ2MmQ5N2I5YTI2ZTZhMzE3YzkzOWFhZDhkMzQ4M2FiNTJiNWUxYWIxODQ1
|
15
|
+
OGVmYzk2N2YwOGViOTg5NDQ3YWU0Y2EyZDk0OThjNTY3ZDQxMDA=
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Waistband
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/taskrabbit/waistband.png?branch=master)](https://travis-ci.org/taskrabbit/waistband)
|
4
|
+
|
3
5
|
Configuration and sensible defaults for ElasticSearch on Ruby. Handles configuration, index creation, quality of life, etc, of Elastic Search in Ruby.
|
4
6
|
|
7
|
+
Waistband doens't handle connections or API requests, it merely acts as a translator between commonly used patterns and the underlying elasticsearch gems.
|
8
|
+
|
5
9
|
# Installation
|
6
10
|
|
7
11
|
Install ElasticSearch:
|
@@ -39,7 +43,9 @@ development:
|
|
39
43
|
port: 9200
|
40
44
|
```
|
41
45
|
|
42
|
-
You can name the servers whatever you want
|
46
|
+
You can name the servers whatever you want. The connection, retries, timeouts, etc are handled by the `elasticsearch-transport` gem.
|
47
|
+
|
48
|
+
Here's an example with two servers:
|
43
49
|
|
44
50
|
```yml
|
45
51
|
# #{APP_DIR}/config/waistband/waistband.yml
|
@@ -73,6 +79,33 @@ development:
|
|
73
79
|
includes: ["*"]
|
74
80
|
```
|
75
81
|
|
82
|
+
Note that you can configure specific connection settings for a particular index, if for some reason or another that index in particular uses a different set of servers:
|
83
|
+
|
84
|
+
```yml
|
85
|
+
development:
|
86
|
+
connection:
|
87
|
+
timeout: 2
|
88
|
+
retries: 5
|
89
|
+
reload_on_failure: true
|
90
|
+
servers:
|
91
|
+
server1:
|
92
|
+
host: 192.168.31.112
|
93
|
+
port: 9200
|
94
|
+
protocol: http
|
95
|
+
server2:
|
96
|
+
host: 192.168.31.113
|
97
|
+
port: 9200
|
98
|
+
protocol: http
|
99
|
+
settings:
|
100
|
+
index:
|
101
|
+
number_of_shards: 1
|
102
|
+
number_of_replicas: 1
|
103
|
+
mappings:
|
104
|
+
event:
|
105
|
+
_source:
|
106
|
+
includes: ["*"]
|
107
|
+
```
|
108
|
+
|
76
109
|
## List of config settings:
|
77
110
|
|
78
111
|
* `settings`: settings for the Elastic Search index. Refer to the ["admin indices update settings"](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/) document for more info.
|
@@ -82,6 +115,8 @@ development:
|
|
82
115
|
* `timeout`: seconds till a timeout exception is raise when trying to connect to the node.
|
83
116
|
* `name`: optional - name of the index. You can (and probably should) have a different name for the index for your test environment. If not specified, it defaults to the name of the yml file minus the `waistband_` portion, so in the above example, the index name would become `search_#{env}`, where env is your environment variable as defined in `Waistband::Configuration#setup` (determined by `RAILS_ENV` or `RACK_ENV`).
|
84
117
|
* `stringify`: optional - determines wether whatever is stored into the index is going to be converted to a string before storage. Usually false unless you need it to be true for specific cases, like if for some `key => value` pairs the value is of different types some times.
|
118
|
+
* `connection`: optional - determines which server/s the index uses. If not present, it'll use the default connection settings specified in `config/waistband.yml`.
|
119
|
+
* `permissions`: optional - determines which permissions to allow on this index, please refer to the [permissions section](#permissions) for more information.
|
85
120
|
|
86
121
|
## Initializer
|
87
122
|
|
@@ -220,6 +255,42 @@ index.alias_exists?('my_super_events_alias') # => true
|
|
220
255
|
|
221
256
|
The `alias` methods receives a param to define the alias name. The same pattern can be used when using index versions.
|
222
257
|
|
258
|
+
### Permissions
|
259
|
+
|
260
|
+
We've found it safer to tighten up the permissions to determine which actions can be done on each index based on environments. For example, you might want to allow an index to be created and deleted at will on the development or staging environments, but you probably don't want to allow it to be deleted on production. To that effect, you're able to set permissions on each index's config file:
|
261
|
+
|
262
|
+
```yml
|
263
|
+
production:
|
264
|
+
permissions:
|
265
|
+
create: true
|
266
|
+
delete_index: false
|
267
|
+
destroy: true
|
268
|
+
read: true
|
269
|
+
write: true
|
270
|
+
```
|
271
|
+
|
272
|
+
By default, all permissions are true unless set otherwise.
|
273
|
+
|
274
|
+
The specific permissions are:
|
275
|
+
|
276
|
+
* `create`: can Waistband create the index?
|
277
|
+
* `delete_index`: can Waistband delete the entire index?
|
278
|
+
* `destroy`: can Waistband destroy an object in the index?
|
279
|
+
* `read`: can Waistband `read`, `find`, or `find_result` in the index?
|
280
|
+
* `write`: can Waistband `save` (create or update) an object to the index?
|
281
|
+
|
282
|
+
### Logging
|
283
|
+
|
284
|
+
It's very useful to log what the output from all operations is, with that in mind, you can specify a log for Waistband easily:
|
285
|
+
|
286
|
+
```ruby
|
287
|
+
Waistband.configure do |c|
|
288
|
+
c.logger = Rails.logger.dup
|
289
|
+
end
|
290
|
+
```
|
291
|
+
|
292
|
+
You can do this in an initializer, even the same initializer you used to specify the `config_dir` ealirer if you did so.
|
293
|
+
|
223
294
|
## Contributing
|
224
295
|
|
225
296
|
1. Fork it
|
data/lib/waistband/errors.rb
CHANGED
@@ -1,9 +1,20 @@
|
|
1
1
|
module Waistband
|
2
2
|
module Errors
|
3
3
|
|
4
|
+
module Permissions
|
5
|
+
class PermissionError < StandardError; end
|
6
|
+
|
7
|
+
class Create < PermissionError; end
|
8
|
+
class DeleteIndex < PermissionError; end
|
9
|
+
class Destroy < PermissionError; end
|
10
|
+
class Read < PermissionError; end
|
11
|
+
class Write < PermissionError; end
|
12
|
+
end
|
13
|
+
|
4
14
|
class IndexExists < StandardError; end
|
5
15
|
class IndexNotFound < StandardError; end
|
6
16
|
class NoSearchHits < StandardError; end
|
17
|
+
class UnableToSave < StandardError; end
|
7
18
|
|
8
19
|
end
|
9
20
|
end
|
data/lib/waistband/index.rb
CHANGED
@@ -3,6 +3,7 @@ require 'active_support/core_ext/array/extract_options'
|
|
3
3
|
require 'active_support/core_ext/string/inflections'
|
4
4
|
require 'active_support/core_ext/object/blank'
|
5
5
|
require 'active_support/core_ext/object/try'
|
6
|
+
require 'active_support/core_ext/hash/reverse_merge'
|
6
7
|
require 'elasticsearch'
|
7
8
|
|
8
9
|
module Waistband
|
@@ -39,12 +40,16 @@ module Waistband
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def update_all_mappings
|
43
|
+
check_permission!('create')
|
44
|
+
|
42
45
|
responses = types.map do |type|
|
43
46
|
update_mapping(type).merge('_type' => type)
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
47
50
|
def update_mapping(type)
|
51
|
+
check_permission!('create')
|
52
|
+
|
48
53
|
properties = config['mappings'][type]['properties'] || {}
|
49
54
|
|
50
55
|
mapping_hash = {type => {properties: properties}}
|
@@ -57,6 +62,8 @@ module Waistband
|
|
57
62
|
end
|
58
63
|
|
59
64
|
def update_settings
|
65
|
+
check_permission!('create')
|
66
|
+
|
60
67
|
client.indices.put_settings(
|
61
68
|
index: config_name,
|
62
69
|
body: settings
|
@@ -70,7 +77,9 @@ module Waistband
|
|
70
77
|
end
|
71
78
|
|
72
79
|
def create!
|
73
|
-
|
80
|
+
check_permission!('create')
|
81
|
+
|
82
|
+
client.indices.create index: config_name, body: config.except('name', 'permissions', 'stringify', 'log_level')
|
74
83
|
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => ex
|
75
84
|
raise ex unless ex.message.to_s =~ /IndexAlreadyExistsException/
|
76
85
|
raise ::Waistband::Errors::IndexExists.new("Index already exists")
|
@@ -83,13 +92,17 @@ module Waistband
|
|
83
92
|
end
|
84
93
|
|
85
94
|
def delete!
|
95
|
+
check_permission!('delete_index')
|
96
|
+
|
86
97
|
client.indices.delete index: config_name
|
87
98
|
rescue Elasticsearch::Transport::Transport::Errors::NotFound => ex
|
88
99
|
raise ex unless ex.message.to_s =~ /IndexMissingException/
|
89
100
|
raise ::Waistband::Errors::IndexNotFound.new("Index not found")
|
90
101
|
end
|
91
102
|
|
92
|
-
def save(*args)
|
103
|
+
def save!(*args)
|
104
|
+
check_permission!('write')
|
105
|
+
|
93
106
|
body_hash = args.extract_options!
|
94
107
|
id = args.first
|
95
108
|
_type = body_hash.delete(:_type) || body_hash.delete('_type') || default_type_name
|
@@ -106,7 +119,17 @@ module Waistband
|
|
106
119
|
body: body_hash
|
107
120
|
)
|
108
121
|
|
109
|
-
saved['_id'].present?
|
122
|
+
unless saved['_id'].present?
|
123
|
+
raise ::Waistband::Errors::UnableToSave.new("Unable to save to index: #{config_name}, type: #{_type}, id: #{id}: result: #{saved}")
|
124
|
+
end
|
125
|
+
|
126
|
+
saved
|
127
|
+
end
|
128
|
+
|
129
|
+
def save(*args)
|
130
|
+
save!(*args)
|
131
|
+
rescue ::Waistband::Errors::UnableToSave => ex
|
132
|
+
false
|
110
133
|
end
|
111
134
|
|
112
135
|
def find(id, options = {})
|
@@ -138,6 +161,8 @@ module Waistband
|
|
138
161
|
end
|
139
162
|
|
140
163
|
def read!(id, options = {})
|
164
|
+
check_permission!('read')
|
165
|
+
|
141
166
|
options = options.with_indifferent_access
|
142
167
|
type = options[:_type] || default_type_name
|
143
168
|
|
@@ -155,6 +180,8 @@ module Waistband
|
|
155
180
|
end
|
156
181
|
|
157
182
|
def destroy!(id, options = {})
|
183
|
+
check_permission!('destroy')
|
184
|
+
|
158
185
|
options = options.with_indifferent_access
|
159
186
|
type = options[:_type] || default_type_name
|
160
187
|
|
@@ -168,8 +195,10 @@ module Waistband
|
|
168
195
|
def search(body_hash)
|
169
196
|
page, page_size = get_page_info body_hash
|
170
197
|
body_hash = parse_search_body(body_hash)
|
198
|
+
_type = body_hash.delete(:_type)
|
171
199
|
search_hash = {index: config_name, body: body_hash}
|
172
200
|
|
201
|
+
search_hash[:type] = _type if _type
|
173
202
|
search_hash[:from] = body_hash[:from] if body_hash[:from]
|
174
203
|
search_hash[:size] = body_hash[:size] if body_hash[:size]
|
175
204
|
|
@@ -297,9 +326,17 @@ module Waistband
|
|
297
326
|
end
|
298
327
|
|
299
328
|
def default_type_name
|
329
|
+
return default_type_name_from_mappings if default_type_name_from_mappings
|
300
330
|
@index_name.singularize
|
301
331
|
end
|
302
332
|
|
333
|
+
def default_type_name_from_mappings
|
334
|
+
@default_type_name_from_mappings ||= begin
|
335
|
+
mappings = (config['mappings'] || {})
|
336
|
+
mappings.keys.first
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
303
340
|
def settings
|
304
341
|
settings = config['settings']['index'].except('number_of_shards')
|
305
342
|
{index: settings}
|
@@ -314,6 +351,24 @@ module Waistband
|
|
314
351
|
"#{@index_name}_#{::Waistband.config.env}"
|
315
352
|
end
|
316
353
|
|
354
|
+
def check_permission!(permission)
|
355
|
+
raise "::Waistband::Errors::Permissions::#{permission.classify}".constantize.new("Don't have enough permissions to #{permission} on index #{config_name}") unless check_permission?(permission)
|
356
|
+
end
|
357
|
+
|
358
|
+
def check_permission?(permission)
|
359
|
+
!!permissions[permission]
|
360
|
+
end
|
361
|
+
|
362
|
+
def permissions
|
363
|
+
@permissions ||= (config['permissions'] || {}).reverse_merge({
|
364
|
+
'create' => true,
|
365
|
+
'delete_index' => true,
|
366
|
+
'destroy' => true,
|
367
|
+
'read' => true,
|
368
|
+
'write' => true
|
369
|
+
}).with_indifferent_access
|
370
|
+
end
|
371
|
+
|
317
372
|
# /private
|
318
373
|
|
319
374
|
end
|
data/lib/waistband/version.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
development: &DEV
|
2
|
+
name: events
|
3
|
+
permissions:
|
4
|
+
create: true
|
5
|
+
delete_index: true
|
6
|
+
destroy: true
|
7
|
+
read: true
|
8
|
+
write: true
|
9
|
+
stringify: true
|
10
|
+
settings:
|
11
|
+
index:
|
12
|
+
number_of_shards: 1
|
13
|
+
number_of_replicas: 1
|
14
|
+
mappings:
|
15
|
+
event:
|
16
|
+
_source:
|
17
|
+
includes: ["*"]
|
18
|
+
|
19
|
+
test:
|
20
|
+
<<: *DEV
|
21
|
+
name: events_test
|
22
|
+
permissions:
|
23
|
+
create: true
|
24
|
+
delete_index: false
|
25
|
+
destroy: true
|
26
|
+
read: true
|
27
|
+
write: true
|
@@ -0,0 +1,21 @@
|
|
1
|
+
development: &DEV
|
2
|
+
name: events
|
3
|
+
permissions:
|
4
|
+
create: false
|
5
|
+
delete_index: false
|
6
|
+
destroy: false
|
7
|
+
read: false
|
8
|
+
write: false
|
9
|
+
stringify: true
|
10
|
+
settings:
|
11
|
+
index:
|
12
|
+
number_of_shards: 1
|
13
|
+
number_of_replicas: 1
|
14
|
+
mappings:
|
15
|
+
event:
|
16
|
+
_source:
|
17
|
+
includes: ["*"]
|
18
|
+
|
19
|
+
test:
|
20
|
+
<<: *DEV
|
21
|
+
name: events_test
|
@@ -69,13 +69,6 @@ describe Waistband::Index do
|
|
69
69
|
expect(response['acknowledged']).to be true
|
70
70
|
end
|
71
71
|
|
72
|
-
it "proxies to the client's search" do
|
73
|
-
result = index.search({})
|
74
|
-
expect(result).to be_a Waistband::SearchResults
|
75
|
-
expect(result.took).to be_present
|
76
|
-
expect(result.hits).to be_an Array
|
77
|
-
end
|
78
|
-
|
79
72
|
it "correctly sets hosts" do
|
80
73
|
expect(index.client.send(:hosts)).to eql([
|
81
74
|
{"host" => "localhost", "port" => 9200, "protocol" => "http"},
|
@@ -83,10 +76,25 @@ describe Waistband::Index do
|
|
83
76
|
])
|
84
77
|
end
|
85
78
|
|
79
|
+
describe "searching" do
|
80
|
+
|
81
|
+
it "proxies to the client's search" do
|
82
|
+
result = index.search({})
|
83
|
+
expect(result).to be_a Waistband::SearchResults
|
84
|
+
expect(result.took).to be_present
|
85
|
+
expect(result.hits).to be_an Array
|
86
|
+
end
|
87
|
+
|
88
|
+
it "does not blow up when an index type is specified" do
|
89
|
+
expect{ index.search({_type: 'event'}) }.to_not raise_error
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
86
94
|
describe "storing" do
|
87
95
|
|
88
96
|
it "stores data" do
|
89
|
-
expect(index.save('__test_write', {'ok' => 'yeah'})).to
|
97
|
+
expect(index.save('__test_write', {'ok' => 'yeah'})).to be_present
|
90
98
|
expect(index.read('__test_write')).to eql({
|
91
99
|
'_id' => '__test_write',
|
92
100
|
'_index' => 'events_test',
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Waistband::Index - Permissions" do
|
4
|
+
|
5
|
+
let(:index) { Waistband::Index.new('events') }
|
6
|
+
let(:index2) { Waistband::Index.new('events_with_permissions') }
|
7
|
+
let(:index3) { Waistband::Index.new('events_with_env_permissions') }
|
8
|
+
|
9
|
+
it "detaults all permissions to true when not found" do
|
10
|
+
expect(index.send(:permissions)).to eql({
|
11
|
+
'create' => true,
|
12
|
+
'delete_index' => true,
|
13
|
+
'destroy' => true,
|
14
|
+
'read' => true,
|
15
|
+
'write' => true
|
16
|
+
})
|
17
|
+
end
|
18
|
+
|
19
|
+
it "allows overriding permissions" do
|
20
|
+
expect(index2.send(:permissions)).to eql({
|
21
|
+
'create' => false,
|
22
|
+
'delete_index' => false,
|
23
|
+
'destroy' => false,
|
24
|
+
'read' => false,
|
25
|
+
'write' => false
|
26
|
+
})
|
27
|
+
end
|
28
|
+
|
29
|
+
it "allows environment specific overriding" do
|
30
|
+
expect(index3.send(:permissions)).to eql({
|
31
|
+
'create' => true,
|
32
|
+
'delete_index' => false,
|
33
|
+
'destroy' => true,
|
34
|
+
'read' => true,
|
35
|
+
'write' => true
|
36
|
+
})
|
37
|
+
end
|
38
|
+
|
39
|
+
it "doesn't allow writing" do
|
40
|
+
expect {
|
41
|
+
index2.create!
|
42
|
+
}.to raise_error(Waistband::Errors::Permissions::Create)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "doesn't allow deleting" do
|
46
|
+
expect {
|
47
|
+
index2.delete!
|
48
|
+
}.to raise_error(Waistband::Errors::Permissions::DeleteIndex)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "doesn't allow destroying" do
|
52
|
+
expect {
|
53
|
+
index2.destroy!('123')
|
54
|
+
}.to raise_error(Waistband::Errors::Permissions::Destroy)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "doesn't allow reading" do
|
58
|
+
expect {
|
59
|
+
index2.read!('123')
|
60
|
+
}.to raise_error(Waistband::Errors::Permissions::Read)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "doesn't allow finding" do
|
64
|
+
expect {
|
65
|
+
index2.find!('123')
|
66
|
+
}.to raise_error(Waistband::Errors::Permissions::Read)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "doesn't allow read_resulting" do
|
70
|
+
expect {
|
71
|
+
index2.read_result!('123')
|
72
|
+
}.to raise_error(Waistband::Errors::Permissions::Read)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "doesn't allow writing" do
|
76
|
+
expect {
|
77
|
+
index2.save!('123', {ok: 'nook'})
|
78
|
+
}.to raise_error(Waistband::Errors::Permissions::Write)
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Waistband::Index - Type" do
|
4
|
+
|
5
|
+
it "defaults to the first type we find in the mappings if possible" do
|
6
|
+
index = Waistband::Index.new('events_no_name')
|
7
|
+
expect(index.send(:default_type_name)).to eql 'event'
|
8
|
+
end
|
9
|
+
|
10
|
+
it "defaults to singular index name if no mappings" do
|
11
|
+
index = Waistband::Index.new('no_mappings')
|
12
|
+
expect(index.send(:default_type_name)).to eql 'no_mapping'
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -22,7 +22,7 @@ describe Waistband::Index do
|
|
22
22
|
it "works" do
|
23
23
|
index.delete
|
24
24
|
index.create
|
25
|
-
index.save('testing123', {ok: 'yeah'})
|
25
|
+
saved = index.save('testing123', {ok: 'yeah'})
|
26
26
|
index.refresh
|
27
27
|
data = index.read('testing123')
|
28
28
|
expect(data['_source']['ok']).to eql 'yeah'
|
data/spec/spec_helper.rb
CHANGED
@@ -8,7 +8,10 @@ require 'waistband'
|
|
8
8
|
require 'rspec'
|
9
9
|
require 'timecop'
|
10
10
|
require 'active_support/core_ext/integer/time'
|
11
|
-
|
11
|
+
|
12
|
+
unless ENV['ON_TRAVIS']
|
13
|
+
require 'debugger'
|
14
|
+
end
|
12
15
|
|
13
16
|
Dir["#{APP_DIR}/spec/support/**/*.rb"].each {|f| require f}
|
14
17
|
|
data/spec/support/fake_log.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waistband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jairala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- .rspec
|
93
93
|
- .ruby-gemset
|
94
94
|
- .ruby-version
|
95
|
+
- .travis.yml
|
95
96
|
- Gemfile
|
96
97
|
- LICENSE.txt
|
97
98
|
- README.md
|
@@ -109,13 +110,18 @@ files:
|
|
109
110
|
- spec/config/waistband/waistband.yml
|
110
111
|
- spec/config/waistband/waistband_events.yml
|
111
112
|
- spec/config/waistband/waistband_events_no_name.yml
|
113
|
+
- spec/config/waistband/waistband_events_with_env_permissions.yml
|
114
|
+
- spec/config/waistband/waistband_events_with_permissions.yml
|
112
115
|
- spec/config/waistband/waistband_geo.yml
|
113
116
|
- spec/config/waistband/waistband_multi_connection_events.yml
|
117
|
+
- spec/config/waistband/waistband_no_mappings.yml
|
114
118
|
- spec/config/waistband/waistband_search.yml
|
115
119
|
- spec/lib/body_size_logging_spec.rb
|
116
120
|
- spec/lib/configuration_spec.rb
|
121
|
+
- spec/lib/index/index_spec.rb
|
122
|
+
- spec/lib/index/permissions_spec.rb
|
123
|
+
- spec/lib/index/type_spec.rb
|
117
124
|
- spec/lib/index_multi_connection_spec.rb
|
118
|
-
- spec/lib/index_spec.rb
|
119
125
|
- spec/lib/result_spec.rb
|
120
126
|
- spec/lib/search_results_spec.rb
|
121
127
|
- spec/spec_helper.rb
|
@@ -150,13 +156,18 @@ test_files:
|
|
150
156
|
- spec/config/waistband/waistband.yml
|
151
157
|
- spec/config/waistband/waistband_events.yml
|
152
158
|
- spec/config/waistband/waistband_events_no_name.yml
|
159
|
+
- spec/config/waistband/waistband_events_with_env_permissions.yml
|
160
|
+
- spec/config/waistband/waistband_events_with_permissions.yml
|
153
161
|
- spec/config/waistband/waistband_geo.yml
|
154
162
|
- spec/config/waistband/waistband_multi_connection_events.yml
|
163
|
+
- spec/config/waistband/waistband_no_mappings.yml
|
155
164
|
- spec/config/waistband/waistband_search.yml
|
156
165
|
- spec/lib/body_size_logging_spec.rb
|
157
166
|
- spec/lib/configuration_spec.rb
|
167
|
+
- spec/lib/index/index_spec.rb
|
168
|
+
- spec/lib/index/permissions_spec.rb
|
169
|
+
- spec/lib/index/type_spec.rb
|
158
170
|
- spec/lib/index_multi_connection_spec.rb
|
159
|
-
- spec/lib/index_spec.rb
|
160
171
|
- spec/lib/result_spec.rb
|
161
172
|
- spec/lib/search_results_spec.rb
|
162
173
|
- spec/spec_helper.rb
|