test_track_rails_client 8.3.0 → 8.5.0

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: 7155e55ee2ec7d9ced95f7de4faa03feec95bfe1fb9830dfb2a012b7cd11b34b
4
- data.tar.gz: 1a1c8a21189a7b4d238044e84f054b750d844332d054228f052298c7c214bc39
3
+ metadata.gz: 681b22241706e0cfa2bd39185caeb5a69705f530382173c2518bb5018a663df1
4
+ data.tar.gz: b5b3b10ddd349be7cd4eb59b33805484e39ed1c00c6257bd7ec597dc813366c9
5
5
  SHA512:
6
- metadata.gz: 5ea097e9c30b36f6404549bc28f63450a107bbdb3ae453c08b06145f663acae6ecd150b67b93b97cca081f89bb67c47e7cd5bd83a90cc60a9eed73dcc9f40c2e
7
- data.tar.gz: 4ef7dbe0e61497b894314e0e95cc5e85ac4941bfd7cba278e823d3862800dae86a393d2f4dbfea20230c88722f83db8c218174c16d763f58085f458844a5d792
6
+ metadata.gz: fa2a384138a145c1f711b4379f8b651c12c9cc1f7991618806ce9d0ca38b77b8279e06320fb3e15692c9a0ece437ac09226fd4fefa3d278b1e14dd08146d4eb1
7
+ data.tar.gz: 4b2fe01b15fbbda9b1dced89ca02808dec6d65337d1bfaaaf54f9881242a33551e7b8b2910a156822bd5cff74d0991a60894212dbca420ed568905a26a3ff765
@@ -15,6 +15,12 @@ module TestTrack::Controller
15
15
  raise ActionController::RoutingError, 'Not Found' unless test_track_visitor.ab(feature_flag, context: self.class.name.underscore)
16
16
  end
17
17
  end
18
+
19
+ def reject_feature_flag(feature_flag, *args)
20
+ before_action(*args) do
21
+ raise ActionController::RoutingError, 'Not Found' if test_track_visitor.ab(feature_flag, context: self.class.name.underscore)
22
+ end
23
+ end
18
24
  end
19
25
 
20
26
  private
@@ -37,16 +37,26 @@ class TestTrack::Fake::SplitRegistry
37
37
  end
38
38
 
39
39
  def _schema_registry
40
- file = File.exist?(schema_yml_path) &&
41
- YAML.load_file(schema_yml_path)
40
+ file =
41
+ if File.exist?(schema_json_path)
42
+ JSON.parse(File.read(schema_json_path))
43
+ elsif File.exist?(schema_yml_path)
44
+ YAML.load_file(schema_yml_path)
45
+ end
46
+
42
47
  file && file['splits'].each_with_object(ActiveSupport::HashWithIndifferentAccess.new) do |split, h|
43
48
  h[split['name']] = split['weights']
44
49
  end
45
50
  end
46
51
 
52
+ def schema_json_path
53
+ base = ENV['TEST_TRACK_SCHEMA_ROOT'] || Rails.root
54
+ File.join(base, 'testtrack/schema.json')
55
+ end
56
+
47
57
  def schema_yml_path
48
58
  base = ENV['TEST_TRACK_SCHEMA_ROOT'] || Rails.root
49
- File.join(base, 'testtrack', 'schema.yml')
59
+ File.join(base, 'testtrack/schema.yml')
50
60
  end
51
61
 
52
62
  def legacy_test_track_schema_yml
@@ -1,3 +1,3 @@
1
1
  module TestTrackRailsClient
2
- VERSION = "8.3.0".freeze
2
+ VERSION = "8.5.0".freeze
3
3
  end
data/lib/testtrack_cli.rb CHANGED
@@ -9,7 +9,7 @@ class TesttrackCli
9
9
  end
10
10
 
11
11
  def project_initialized?
12
- File.exist?(File.join('testtrack', 'schema.yml'))
12
+ File.exist?('testtrack/schema.json') || File.exist?('testtrack/schema.yml')
13
13
  end
14
14
 
15
15
  def call(*args)
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: 8.3.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan O'Neill
@@ -455,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
455
455
  - !ruby/object:Gem::Version
456
456
  version: '0'
457
457
  requirements: []
458
- rubygems_version: 3.6.8
458
+ rubygems_version: 4.0.6
459
459
  specification_version: 4
460
460
  summary: Rails client for TestTrack
461
461
  test_files: []