prefab-cloud-ruby 1.4.4 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63cf097502ebcd1f22ed834cbd4501db2ba7f98b3ebe993b89098f1f105fb2e2
4
- data.tar.gz: 65458a292125bf925a6609c6cd152b205d94a05a16a4e0cdff9b5460fb6348f1
3
+ metadata.gz: 99c0376c6062b2d2ae5c51c5f5cfd15841255e706946e01558cb0dde9e7a4672
4
+ data.tar.gz: 699a13518c92d9c8fcc4f45b8c501b4d96836c49353c762fb50f7f4410546287
5
5
  SHA512:
6
- metadata.gz: 3df29876ef54909d2e605edd1f3d9e947a0c72bfb9d8f86508c517bec392a7c0d2c8c13ca022161c6a964bdeb55ee2d647d7c789888e6fbe9d9a39db516d279b
7
- data.tar.gz: 183e645a10ad9db7525f2c2d2bd3cecc8826fc161a9ef4e207ec1f45e2fc5a2b41e732e8ede429ac0d91a1fae5c873c9d532ff8f0b273872abeede7698b08e78
6
+ metadata.gz: c598fd1f773d2a846b78b06375e10b19053685a7b0a42fc1324a7e129ec27d5ab5494b795ceed32856144e58395f7414ae6540ff704ef1cb137f07f62ab5cfde
7
+ data.tar.gz: 4d576e90e3823359b81211b70f70b566c5fe1489314733d0ebd0ed6b9af966299111d79f1eb38a5ce019153ff9241e3d5f86440031b30aace7187c7c63194c56
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.5 - 2024-01-31
4
+
5
+ - Refactor out a `should_log?` method (#170)
6
+
3
7
  ## 1.4.4 - 2024-01-26
4
8
 
5
9
  - Raise when ENV var is missing
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.4
1
+ 1.4.5
@@ -75,9 +75,9 @@ module Prefab
75
75
 
76
76
  def log(message, path, progname, severity, log_context = {})
77
77
  severity ||= ::Logger::UNKNOWN
78
- @log_path_aggregator&.push(path, severity)
79
78
 
80
- return true if @logdev.nil? || severity < level_of(path) || @silences[local_log_id]
79
+ return true if !should_log? severity, path
80
+ return true if @logdev.nil? || @silences[local_log_id]
81
81
 
82
82
  progname = @progname if progname.nil?
83
83
 
@@ -96,6 +96,11 @@ module Prefab
96
96
  true
97
97
  end
98
98
 
99
+ def should_log?(severity, path)
100
+ @log_path_aggregator&.push(path, severity)
101
+ severity >= level_of(path)
102
+ end
103
+
99
104
  def debug(progname = nil, **log_context, &block)
100
105
  add_internal(DEBUG, nil, progname, caller_locations(1, 1)[0], log_context, &block)
101
106
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: prefab-cloud-ruby 1.4.4 ruby lib
5
+ # stub: prefab-cloud-ruby 1.4.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "prefab-cloud-ruby".freeze
9
- s.version = "1.4.4"
9
+ s.version = "1.4.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2024-01-26"
14
+ s.date = "2024-01-31"
15
15
  s.description = "Feature Flags, Live Config, and Dynamic Log Levels as a service".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["console".freeze]
@@ -9,7 +9,7 @@ class IntegrationTest
9
9
  @input = parse_input(test_data['input'])
10
10
  @expected = parse_expected(test_data['expected'])
11
11
  @data = test_data['data']
12
- @expected_data = test_data['expected_data']
12
+ @expected_data = test_data['expected_data'] || []
13
13
  @aggregator = test_data['aggregator']
14
14
  @endpoint = test_data['endpoint']
15
15
  @test_client = capture_telemetry(base_client)
@@ -115,23 +115,23 @@ module IntegrationTestHelpers
115
115
  when "example_contexts"
116
116
  aggregator = it.test_client.example_contexts_aggregator
117
117
 
118
- it.data.each do |hash|
119
- aggregator.record(Prefab::Context.new(hash))
118
+ it.data.each do |key, values|
119
+ aggregator.record(Prefab::Context.new({ key => values }))
120
120
  end
121
121
 
122
122
  expected_data = []
123
- it.expected_data.each do |data|
123
+ it.expected_data.each do |k, vs|
124
124
  expected_data << PrefabProto::ExampleContext.new(
125
125
  timestamp: 0,
126
126
  contextSet: PrefabProto::ContextSet.new(
127
- contexts: data.map do |(k, vs)|
127
+ contexts: [
128
128
  PrefabProto::Context.new(
129
129
  type: k,
130
130
  values: vs.each_pair.map do |key, value|
131
131
  [key, Prefab::ConfigValueWrapper.wrap(value)]
132
132
  end.to_h
133
133
  )
134
- end
134
+ ]
135
135
  )
136
136
  )
137
137
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prefab-cloud-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-26 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby