test_track_rails_client 4.0.1 → 4.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a4e66371e5bfdda4c10e9f0e7ee91fb458bb67e58e624bb2c9349f6d7bfd6a7
4
- data.tar.gz: e07a71f4d00429b0ccbb7722c2f247ab23f87e622b04011d4c80c2812a1a5d6e
3
+ metadata.gz: 854dd7b85c56a6b115c1c36ae4139fcc066290c78611260efe7e1a5cba5873db
4
+ data.tar.gz: 31ebfcbc833a484c4406faadbbe4c6dafb02e3e1ff1451a190628a964455a635
5
5
  SHA512:
6
- metadata.gz: ce33a99b61265af0eb5fbc2a8b978d5e383c28e00f294cf2331759690bd6eec296d10d96b6b4e61e51f89488ffebf103eceb67cb4334b840478903bdb8d8f4b0
7
- data.tar.gz: 97dc832aa1656acfd345223dfae3f43208e0a6eeb42ef440fe616cdfd631b4c5dd03b627452fe243fce794bae6c210dea32045bdcc67487a6216acadd1b7922f
6
+ metadata.gz: a979df0d5cb9f1439c22a099f717709993d1eb78648fe88e1251faa2f9d5d15645a748dd6cb9c981c521a0af34affdea1be700cb831c6a258bb148fbab5912c8
7
+ data.tar.gz: af422d4454c05b9a548aafcb5953f2ec4db0853a2f31d44f5afb14deea418974ae7bfc2232ce94afa89ed8068f989f8ef752426de64e5fff3ad7e236efe3e633
data/README.md CHANGED
@@ -48,6 +48,7 @@ Set up ENV vars in every environment:
48
48
 
49
49
  * `MIXPANEL_TOKEN` - By default, TestTrack reports to Mixpanel. If you're using a [custom analytics provider](#analytics) you can omit this.
50
50
  * `TEST_TRACK_API_URL` - Set this to the URL of your TestTrack instance with your app credentials, e.g. `http://[myapp]:[your new app password]@[your-app-domain]/`
51
+ * `TEST_TRACK_PUBLIC_API_URL` - (optional) If public traffic to TestTrack should use a different host name, set this variable. By default this will use `TEST_TRACK_API_URL` without any credentials
51
52
 
52
53
  [your-app-domain] can be
53
54
  * `testtrack.test`
@@ -25,7 +25,7 @@ class TestTrack::WebSession
25
25
 
26
26
  def state_hash
27
27
  {
28
- url: TestTrack.url,
28
+ url: TestTrack.public_url,
29
29
  cookieDomain: cookie_domain,
30
30
  cookieName: visitor_cookie_name,
31
31
  splits: current_visitor.split_registry.to_hash,
data/lib/test_track.rb CHANGED
@@ -115,7 +115,15 @@ module TestTrack
115
115
  yield(ConfigUpdater.new)
116
116
  end
117
117
 
118
- def url
118
+ def public_url
119
+ ENV['TEST_TRACK_PUBLIC_API_URL'] || _uncredentialed_private_url
120
+ end
121
+
122
+ def private_url
123
+ ENV['TEST_TRACK_API_URL']
124
+ end
125
+
126
+ def _uncredentialed_private_url
119
127
  return nil unless private_url
120
128
 
121
129
  full_uri = URI.parse(private_url)
@@ -124,10 +132,6 @@ module TestTrack
124
132
  full_uri.to_s
125
133
  end
126
134
 
127
- def private_url
128
- ENV['TEST_TRACK_API_URL']
129
- end
130
-
131
135
  def _build_timestamp
132
136
  File.read(BUILD_TIMESTAMP_FILE_PATH).chomp.presence if File.exist?(BUILD_TIMESTAMP_FILE_PATH)
133
137
  end
@@ -1,3 +1,3 @@
1
1
  module TestTrackRailsClient
2
- VERSION = "4.0.1" # rubocop:disable Style/MutableConstant
2
+ VERSION = "4.0.2" # rubocop:disable Style/MutableConstant
3
3
  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: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan O'Neill
@@ -10,10 +10,10 @@ authors:
10
10
  - John Mileham
11
11
  - Alan Norton
12
12
  - Sam Moore
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-02-01 00:00:00.000000000 Z
16
+ date: 2021-03-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: delayed_job
@@ -448,7 +448,7 @@ homepage: https://github.com/Betterment
448
448
  licenses:
449
449
  - MIT
450
450
  metadata: {}
451
- post_install_message:
451
+ post_install_message:
452
452
  rdoc_options: []
453
453
  require_paths:
454
454
  - lib
@@ -463,8 +463,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
463
463
  - !ruby/object:Gem::Version
464
464
  version: '0'
465
465
  requirements: []
466
- rubygems_version: 3.2.5
467
- signing_key:
466
+ rubygems_version: 3.1.4
467
+ signing_key:
468
468
  specification_version: 4
469
469
  summary: Rails client for TestTrack
470
470
  test_files: []