test_track_rails_client 7.0.0 → 7.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -4
- data/app/controllers/concerns/test_track/controller.rb +2 -4
- data/app/models/test_track/ab_configuration.rb +1 -1
- data/app/models/test_track/identity_session_locator.rb +2 -4
- data/app/models/test_track/offline_session.rb +4 -8
- data/app/models/test_track/vary_dsl.rb +1 -0
- data/app/models/test_track/web_session.rb +2 -2
- data/lib/test_track.rb +1 -1
- data/lib/test_track_rails_client/engine.rb +4 -0
- data/lib/test_track_rails_client/version.rb +1 -1
- metadata +6 -7
- data/config/initializers/set_build_timestamp.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1c0d5e3f14e82a63f34d8ab019c2f433014cdcf590ba339e70cf54996178a1a
|
4
|
+
data.tar.gz: e45737b7d5dba5cffec0219292091252fbac298ac48189cbf827cde52c408d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b892995788d2baccf116d1cf233fd763159b9047a068196feb4fa89dbc70c0ffc6ab1670d1d57da9bdd5359f9d8f455619a456e0a4b70f93b84df966a1122af
|
7
|
+
data.tar.gz: 15e46fb3134a62060b3bf931f0b99912151bc75c3be74493c8b12956951d42a67014101086f773f002abfcce661a058485969c24f0f613413fd2ec57e6fd6160
|
data/Rakefile
CHANGED
@@ -28,12 +28,12 @@ RuboCop::RakeTask.new
|
|
28
28
|
|
29
29
|
desc "Pull the latest versions of all dependencies into the gem for distribution"
|
30
30
|
task :vendor_deps do
|
31
|
-
|
32
|
-
|
31
|
+
test_track_js_client_version = '2.0.0'.freeze
|
32
|
+
test_track_cli_version = 'v1.2.0'.freeze
|
33
33
|
|
34
34
|
# Bundle JS client
|
35
35
|
sh 'npm init -y'
|
36
|
-
sh "npm install --no-save test_track_js_client@#{
|
36
|
+
sh "npm install --no-save test_track_js_client@#{test_track_js_client_version}"
|
37
37
|
sh 'cp', 'node_modules/test_track_js_client/dist/testTrack.bundle.js', 'app/assets/javascripts/testTrack.bundle.min.js'
|
38
38
|
sh 'rm package.json'
|
39
39
|
|
@@ -44,7 +44,7 @@ task :vendor_deps do
|
|
44
44
|
rm_r Dir.glob('*')
|
45
45
|
|
46
46
|
%w(darwin linux).each do |arch|
|
47
|
-
`curl -L https://github.com/Betterment/testtrack-cli/releases/download/#{
|
47
|
+
`curl -L https://github.com/Betterment/testtrack-cli/releases/download/#{test_track_cli_version}/testtrack.#{arch} \
|
48
48
|
> testtrack.#{arch}`
|
49
49
|
chmod 'u=wrx,go=rx', "testtrack.#{arch}"
|
50
50
|
end
|
@@ -27,10 +27,8 @@ module TestTrack::Controller
|
|
27
27
|
test_track_session.visitor_dsl
|
28
28
|
end
|
29
29
|
|
30
|
-
def manage_test_track_session
|
30
|
+
def manage_test_track_session(&block)
|
31
31
|
RequestStore[:test_track_web_session] = test_track_session
|
32
|
-
test_track_session.manage
|
33
|
-
yield
|
34
|
-
end
|
32
|
+
test_track_session.manage(&block)
|
35
33
|
end
|
36
34
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class TestTrack::AbConfiguration
|
2
2
|
include TestTrack::RequiredOptions
|
3
3
|
|
4
|
-
def initialize(opts)
|
4
|
+
def initialize(opts)
|
5
5
|
@split_name = require_option!(opts, :split_name).to_s
|
6
6
|
true_variant = require_option!(opts, :true_variant, allow_nil: true)
|
7
7
|
@split_registry = require_option!(opts, :split_registry)
|
@@ -5,7 +5,7 @@ class TestTrack::IdentitySessionLocator
|
|
5
5
|
@identity = identity
|
6
6
|
end
|
7
7
|
|
8
|
-
def with_visitor # rubocop:disable Metrics/AbcSize
|
8
|
+
def with_visitor(&block) # rubocop:disable Metrics/AbcSize
|
9
9
|
raise ArgumentError, "must provide block to `with_visitor`" unless block_given?
|
10
10
|
|
11
11
|
if web_session.present?
|
@@ -13,9 +13,7 @@ class TestTrack::IdentitySessionLocator
|
|
13
13
|
elsif job_session.present?
|
14
14
|
yield job_session.visitor_dsl_for(identity)
|
15
15
|
else
|
16
|
-
TestTrack::OfflineSession.with_visitor_for(identity.test_track_identifier_type, identity.test_track_identifier_value)
|
17
|
-
yield v
|
18
|
-
end
|
16
|
+
TestTrack::OfflineSession.with_visitor_for(identity.test_track_identifier_type, identity.test_track_identifier_value, &block)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
@@ -3,24 +3,20 @@ class TestTrack::OfflineSession
|
|
3
3
|
@remote_visitor = remote_visitor
|
4
4
|
end
|
5
5
|
|
6
|
-
def self.with_visitor_for(identifier_type, identifier_value)
|
6
|
+
def self.with_visitor_for(identifier_type, identifier_value, &block)
|
7
7
|
raise ArgumentError, "must provide block to `with_visitor_for`" unless block_given?
|
8
8
|
|
9
9
|
remote_visitor = TestTrack::Remote::Visitor.from_identifier(identifier_type, identifier_value)
|
10
10
|
|
11
|
-
new(remote_visitor).send
|
12
|
-
yield visitor_dsl
|
13
|
-
end
|
11
|
+
new(remote_visitor).send(:manage, &block)
|
14
12
|
end
|
15
13
|
|
16
|
-
def self.with_visitor_id(visitor_id)
|
14
|
+
def self.with_visitor_id(visitor_id, &block)
|
17
15
|
raise ArgumentError, "must provide block to `with_visitor_id`" unless block_given?
|
18
16
|
|
19
17
|
remote_visitor = TestTrack::Remote::Visitor.find(visitor_id)
|
20
18
|
|
21
|
-
new(remote_visitor).send
|
22
|
-
yield visitor_dsl
|
23
|
-
end
|
19
|
+
new(remote_visitor).send(:manage, &block)
|
24
20
|
end
|
25
21
|
|
26
22
|
private
|
@@ -51,7 +51,7 @@ class TestTrack::WebSession
|
|
51
51
|
attr_reader :controller
|
52
52
|
|
53
53
|
def current_identity
|
54
|
-
raise <<~ERROR unless controller.class.test_track_identity
|
54
|
+
raise <<~ERROR unless controller.class.test_track_identity.is_a?(Symbol)
|
55
55
|
Your controller (or controller base class) must set test_track_identity for
|
56
56
|
TestTrack to work properly. e.g.:
|
57
57
|
|
@@ -106,7 +106,7 @@ class TestTrack::WebSession
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def wildcard_domain
|
109
|
-
"
|
109
|
+
".#{public_suffix_domain || request.host}"
|
110
110
|
end
|
111
111
|
|
112
112
|
def public_suffix_domain
|
data/lib/test_track.rb
CHANGED
@@ -17,7 +17,7 @@ module TestTrack
|
|
17
17
|
|
18
18
|
SERVER_ERRORS = [Faraday::ConnectionFailed, Faraday::TimeoutError, Her::Errors::RemoteServerError].freeze
|
19
19
|
BUILD_TIMESTAMP_FILE_PATH = 'testtrack/build_timestamp'.freeze
|
20
|
-
BUILD_TIMESTAMP_REGEX = /\A\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(.\d+)?([+-][0-2]\d:[0-5]\d|Z)\z
|
20
|
+
BUILD_TIMESTAMP_REGEX = /\A\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(.\d+)?([+-][0-2]\d:[0-5]\d|Z)\z/
|
21
21
|
|
22
22
|
mattr_accessor :enabled_override, :app_name
|
23
23
|
mattr_accessor(:job_base_class_name) { 'ActiveJob::Base' }
|
@@ -9,5 +9,9 @@ module TestTrackRailsClient
|
|
9
9
|
config.generators do |g|
|
10
10
|
g.test_framework :rspec
|
11
11
|
end
|
12
|
+
|
13
|
+
initializer after: 'active_support.initialize_time_zone' do
|
14
|
+
TestTrack.set_build_timestamp! unless ENV['SKIP_TESTTRACK_SET_BUILD_TIMESTAMP'] == '1'
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_track_rails_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan O'Neill
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: activejob
|
@@ -217,14 +217,14 @@ dependencies:
|
|
217
217
|
requirements:
|
218
218
|
- - "~>"
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
220
|
+
version: 1.48.0
|
221
221
|
type: :development
|
222
222
|
prerelease: false
|
223
223
|
version_requirements: !ruby/object:Gem::Requirement
|
224
224
|
requirements:
|
225
225
|
- - "~>"
|
226
226
|
- !ruby/object:Gem::Version
|
227
|
-
version:
|
227
|
+
version: 1.48.0
|
228
228
|
- !ruby/object:Gem::Dependency
|
229
229
|
name: rubocop-performance
|
230
230
|
requirement: !ruby/object:Gem::Requirement
|
@@ -382,7 +382,6 @@ files:
|
|
382
382
|
- app/views/tt/api/v1/split_details/show.json.jbuilder
|
383
383
|
- app/views/tt/api/v1/visitors/_show.json.jbuilder
|
384
384
|
- app/views/tt/api/v1/visitors/show.json.jbuilder
|
385
|
-
- config/initializers/set_build_timestamp.rb
|
386
385
|
- config/initializers/test_track_api.rb
|
387
386
|
- config/routes.rb
|
388
387
|
- lib/generators/test_track/migration_generator.rb
|
@@ -447,14 +446,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
447
446
|
requirements:
|
448
447
|
- - ">="
|
449
448
|
- !ruby/object:Gem::Version
|
450
|
-
version:
|
449
|
+
version: '3.0'
|
451
450
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
452
451
|
requirements:
|
453
452
|
- - ">="
|
454
453
|
- !ruby/object:Gem::Version
|
455
454
|
version: '0'
|
456
455
|
requirements: []
|
457
|
-
rubygems_version: 3.
|
456
|
+
rubygems_version: 3.5.6
|
458
457
|
signing_key:
|
459
458
|
specification_version: 4
|
460
459
|
summary: Rails client for TestTrack
|
@@ -1 +0,0 @@
|
|
1
|
-
TestTrack.set_build_timestamp! unless ENV['SKIP_TESTTRACK_SET_BUILD_TIMESTAMP'] == '1'
|