cacheflow 0.3.3 → 0.4.0

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: eba34da0dc206375466ba45b0c4b0f98a41c60d392834c1284922d8164e440c4
4
- data.tar.gz: 8f79e396464f469df15fe53914d3c6217d94850215bc4cf425e5cc17e22e7b4b
3
+ metadata.gz: 175592979961554546a3074ac8f8a411f26e81e695a24418a764e5806736f180
4
+ data.tar.gz: f0c60bd1b5b507872116a7867cf2efa38989ca74c1cc23df5db30e0e7b5f0bbd
5
5
  SHA512:
6
- metadata.gz: a6f11ee4ba48f29577ed35f19961af050a67294e546339d1d7281fc06ee8c82898eb7d176ac6f6a567f0307320d1fef508e3f0144c20aa8235b45fbcc2b22d29
7
- data.tar.gz: 658f979612ec31f88ee7922d6600a1db863809515dfd180c10399748770056ac9e29c8d0cefe795f375927f85680dfb2b814ee8815cecbb983e04228a84d93e8
6
+ metadata.gz: c2f9c3d04f22043652211e50537fe2586d0c61a548f28e6be398067185bc7b07e4dfbad88f134d7b795e95bc4a2ade4727e4143be2740f11895baf0fe41d6c5d
7
+ data.tar.gz: dd4e4f821650260facf20402756af047027689cbea55e9f2014c697a56f76abfc1d1a8cd1841d0ff7388a34ace681d1e1b7a815bfb00ec33ac105afa2042be14
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.0 (2024-10-22)
2
+
3
+ - Improved binary data detection
4
+ - Dropped support for Ruby < 3.1 and Active Support < 7
5
+
1
6
  ## 0.3.3 (2024-02-27)
2
7
 
3
8
  - Fixed error with binary data
data/README.md CHANGED
@@ -4,7 +4,7 @@ Colorized logging for Memcached and Redis
4
4
 
5
5
  Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli) and [Redis](https://github.com/redis/redis-rb) clients directly
6
6
 
7
- [![Build Status](https://github.com/ankane/cacheflow/workflows/build/badge.svg?branch=master)](https://github.com/ankane/cacheflow/actions)
7
+ [![Build Status](https://github.com/ankane/cacheflow/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/cacheflow/actions)
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Cacheflow
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/cacheflow.rb CHANGED
@@ -30,7 +30,14 @@ module Cacheflow
30
30
 
31
31
  # private
32
32
  def self.args(args)
33
- args.map { |v| v.to_s.dup.force_encoding(Encoding::UTF_8).valid_encoding? ? v : "<binary-data>" }.join(" ")
33
+ args.map { |v| binary?(v) ? "<binary-data>" : v }.join(" ")
34
+ end
35
+
36
+ # private
37
+ def self.binary?(v)
38
+ v = v.to_s
39
+ # string encoding creates false positives, so try to determine based on value
40
+ v.include?("\x00") || !v.dup.force_encoding(Encoding::UTF_8).valid_encoding?
34
41
  end
35
42
  end
36
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacheflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-27 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6'
19
+ version: '7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '6'
26
+ version: '7'
27
27
  description:
28
28
  email: andrew@ankane.org
29
29
  executables: []
@@ -51,14 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.7'
54
+ version: '3.1'
55
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubygems_version: 3.5.3
61
+ rubygems_version: 3.5.16
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Colorized logging for Memcached and Redis