airship-ruby 1.1.3 → 1.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 577e120e2dd12d0d8d355f21adfe8d2bf93145c7
4
- data.tar.gz: 563b3918684b1be0d36dc40642a8257fd90fc40c
3
+ metadata.gz: 10b67c13eae597d9734339b612af2911162085a5
4
+ data.tar.gz: f6ef3589fbbc65c2707d52eb60cf94cab521a420
5
5
  SHA512:
6
- metadata.gz: 94df167af112babb0fd21241767a8c4d21339b16e91dbbeea280517f082a25391fea23608979a79af2c1f7313cbe711f1d08d637325c82a82fae17119cd2443f
7
- data.tar.gz: 6f20a23eabb5b79d0b5b0be0078605035197a58c7b3712b922770ea6bebbd843429e868fcbce12e5867ac0b53331fb15919fc3b1c279c43550ac84f2275d92c7
6
+ metadata.gz: 1a5cc2e58db4d1981f89e0b320191476bbf852bc5cf1cc629f22294e8f6d19a6b83ac2e50aafd426fe25071783dd2a34bbd63e204739ee98619f052dae7b801e
7
+ data.tar.gz: 1fea8cf3b1654d14f01c5914282e7d489bd625d8fce038158864af36f2e2d5722b74eceaf3c49c82e2b3e8a8bb033894f34a574d7ffd6243c3d7eeeb48a782f9
data/airship-ruby.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "airship-ruby"
3
- s.version = "1.1.3"
3
+ s.version = "1.1.4"
4
4
  s.licenses = ["MIT"]
5
5
  s.summary = "Airship Ruby SDK"
6
6
  s.description = "Ruby SDK"
data/lib/airship-ruby.rb CHANGED
@@ -204,6 +204,7 @@ class Airship
204
204
  @gate_stats_watcher.execute
205
205
  end
206
206
  @initialization_lock.release
207
+ self
207
208
  end
208
209
 
209
210
  def enabled?(control_short_name, object, default_value=false)
@@ -257,6 +258,8 @@ class Airship
257
258
  stats['sdk_gate_eligibility'] = is_eligible
258
259
  stats['sdk_gate_type'] = 'value'
259
260
 
261
+ self._enrich_with_metadata(control_short_name, stats)
262
+
260
263
  stats['sdk_version'] = sdk_version
261
264
  stats['sdk_id'] = @@sdk_id
262
265
 
@@ -319,6 +322,8 @@ class Airship
319
322
  stats['sdk_gate_eligibility'] = is_eligible
320
323
  stats['sdk_gate_type'] = 'variation'
321
324
 
325
+ self._enrich_with_metadata(control_short_name, stats)
326
+
322
327
  stats['sdk_version'] = sdk_version
323
328
  stats['sdk_id'] = @@sdk_id
324
329
 
@@ -381,6 +386,8 @@ class Airship
381
386
  stats['sdk_gate_eligibility'] = is_eligible
382
387
  stats['sdk_gate_type'] = 'eligibility'
383
388
 
389
+ self._enrich_with_metadata(control_short_name, stats)
390
+
384
391
  stats['sdk_version'] = sdk_version
385
392
  stats['sdk_id'] = @@sdk_id
386
393
 
@@ -394,6 +401,16 @@ class Airship
394
401
 
395
402
  protected
396
403
 
404
+ def _enrich_with_metadata(control_short_name, stats)
405
+ control_info = @gating_info_map[control_short_name]
406
+
407
+ if !control_info.nil?
408
+ stats['sdk_gate_control_id'] = control_info['id']
409
+ end
410
+
411
+ stats['sdk_env_id'] = @gating_info['env']['id']
412
+ end
413
+
397
414
  def _get_gating_info_map(gating_info)
398
415
  map = {}
399
416
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airship-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airship Dev Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday