waistband 0.11.1 → 0.11.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.
- data/lib/waistband/index.rb +5 -3
- data/lib/waistband/version.rb +1 -1
- data/spec/lib/index_spec.rb +19 -0
- metadata +2 -2
data/lib/waistband/index.rb
CHANGED
|
@@ -196,9 +196,11 @@ module Waistband
|
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
def full_alias_name(alias_name)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
unless custom_name?
|
|
200
|
+
"#{alias_name}_#{::Waistband.config.env}"
|
|
201
|
+
else
|
|
202
|
+
alias_name
|
|
203
|
+
end
|
|
202
204
|
end
|
|
203
205
|
|
|
204
206
|
def custom_name?
|
data/lib/waistband/version.rb
CHANGED
data/spec/lib/index_spec.rb
CHANGED
|
@@ -239,6 +239,12 @@ describe Waistband::Index do
|
|
|
239
239
|
expect(index.send(:full_alias_name, 'all_events')).to eql 'all_events_test'
|
|
240
240
|
end
|
|
241
241
|
|
|
242
|
+
it "invoking full_alias_name doesn't mess with @index_name" do
|
|
243
|
+
expect(index.instance_variable_get('@index_name')).to eql 'events'
|
|
244
|
+
expect(index.send(:full_alias_name, 'all_events')).to eql 'all_events_test'
|
|
245
|
+
expect(index.instance_variable_get('@index_name')).to eql 'events'
|
|
246
|
+
end
|
|
247
|
+
|
|
242
248
|
it "if the index has a custom name, the alias name doesn't automatically append the env" do
|
|
243
249
|
index.stub(:config).and_return({
|
|
244
250
|
'name' => 'super_custom'
|
|
@@ -252,6 +258,19 @@ describe Waistband::Index do
|
|
|
252
258
|
expect(index.alias_exists?('events_alias_yo')).to be_true
|
|
253
259
|
end
|
|
254
260
|
|
|
261
|
+
describe 'versioning' do
|
|
262
|
+
|
|
263
|
+
it "invoking full_alias_name doesn't mess with @index_name" do
|
|
264
|
+
index = Waistband::Index.new('events', version: 1)
|
|
265
|
+
index.delete
|
|
266
|
+
index.create
|
|
267
|
+
index.alias('aliased_events')
|
|
268
|
+
|
|
269
|
+
expect(index.instance_variable_get('@index_name')).to eql 'events'
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
end
|
|
273
|
+
|
|
255
274
|
end
|
|
256
275
|
|
|
257
276
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: waistband
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-05-
|
|
12
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|