amplitude-experiment 1.3.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/amplitude-experiment.gemspec +2 -1
  3. data/lib/amplitude-experiment.rb +13 -1
  4. data/lib/experiment/cohort/cohort.rb +25 -0
  5. data/lib/experiment/cohort/cohort_download_api.rb +90 -0
  6. data/lib/experiment/cohort/cohort_loader.rb +39 -0
  7. data/lib/experiment/cohort/cohort_storage.rb +91 -0
  8. data/lib/experiment/cohort/cohort_sync_config.rb +27 -0
  9. data/lib/experiment/deployment/deployment_runner.rb +135 -0
  10. data/lib/experiment/error.rb +37 -0
  11. data/lib/experiment/{local/fetcher.rb → flag/flag_config_fetcher.rb} +20 -3
  12. data/lib/experiment/flag/flag_config_storage.rb +53 -0
  13. data/lib/experiment/local/assignment/assignment.rb +3 -1
  14. data/lib/experiment/local/assignment/assignment_service.rb +15 -14
  15. data/lib/experiment/local/client.rb +83 -39
  16. data/lib/experiment/local/config.rb +26 -2
  17. data/lib/experiment/local/evaluation/evaluation.rb +2 -2
  18. data/lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop.so +0 -0
  19. data/lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop_api.h +1 -1
  20. data/lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop.so +0 -0
  21. data/lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop_api.h +1 -1
  22. data/lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop.dylib +0 -0
  23. data/lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop_api.h +1 -1
  24. data/lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop.dylib +0 -0
  25. data/lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop_api.h +1 -1
  26. data/lib/experiment/remote/client.rb +2 -34
  27. data/lib/experiment/user.rb +53 -19
  28. data/lib/experiment/util/flag_config.rb +60 -0
  29. data/lib/experiment/util/poller.rb +24 -0
  30. data/lib/experiment/util/topological_sort.rb +39 -0
  31. data/lib/experiment/util/user.rb +41 -0
  32. data/lib/experiment/util/variant.rb +32 -0
  33. data/lib/experiment/variant.rb +3 -1
  34. data/lib/experiment/version.rb +1 -1
  35. metadata +31 -5
@@ -17,7 +17,9 @@ module AmplitudeExperiment
17
17
 
18
18
  # @param [String] value The value of the variant determined by the flag configuration.
19
19
  # @param [Object, nil] payload The attached payload, if any.
20
- def initialize(value, payload = nil, key = nil, metadata = nil)
20
+ # @param [String] key The key of the variant determined by the flag configuration.
21
+ # @param [Object, nil] metadata The attached metadata, if any.
22
+ def initialize(value: nil, payload: nil, key: nil, metadata: nil)
21
23
  @key = key
22
24
  @value = value
23
25
  @payload = payload
@@ -1,3 +1,3 @@
1
1
  module AmplitudeExperiment
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplitude-experiment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amplitude
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '1.21'
89
+ version: 1.22.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '1.21'
96
+ version: 1.22.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.9'
139
+ - !ruby/object:Gem::Dependency
140
+ name: dotenv
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 2.8.1
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 2.8.1
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: ffi
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -175,9 +189,17 @@ files:
175
189
  - lib/amplitude/timeline.rb
176
190
  - lib/amplitude/utils.rb
177
191
  - lib/amplitude/workers.rb
192
+ - lib/experiment/cohort/cohort.rb
193
+ - lib/experiment/cohort/cohort_download_api.rb
194
+ - lib/experiment/cohort/cohort_loader.rb
195
+ - lib/experiment/cohort/cohort_storage.rb
196
+ - lib/experiment/cohort/cohort_sync_config.rb
178
197
  - lib/experiment/cookie.rb
198
+ - lib/experiment/deployment/deployment_runner.rb
179
199
  - lib/experiment/error.rb
180
200
  - lib/experiment/factory.rb
201
+ - lib/experiment/flag/flag_config_fetcher.rb
202
+ - lib/experiment/flag/flag_config_storage.rb
181
203
  - lib/experiment/local/assignment/assignment.rb
182
204
  - lib/experiment/local/assignment/assignment_config.rb
183
205
  - lib/experiment/local/assignment/assignment_filter.rb
@@ -193,13 +215,17 @@ files:
193
215
  - lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop_api.h
194
216
  - lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop.dylib
195
217
  - lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop_api.h
196
- - lib/experiment/local/fetcher.rb
197
218
  - lib/experiment/persistent_http_client.rb
198
219
  - lib/experiment/remote/client.rb
199
220
  - lib/experiment/remote/config.rb
200
221
  - lib/experiment/user.rb
222
+ - lib/experiment/util/flag_config.rb
201
223
  - lib/experiment/util/hash.rb
202
224
  - lib/experiment/util/lru_cache.rb
225
+ - lib/experiment/util/poller.rb
226
+ - lib/experiment/util/topological_sort.rb
227
+ - lib/experiment/util/user.rb
228
+ - lib/experiment/util/variant.rb
203
229
  - lib/experiment/variant.rb
204
230
  - lib/experiment/version.rb
205
231
  homepage: https://github.com/amplitude/experiment-ruby-server