obfuscator-rb 0.3.1 → 0.3.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +2 -0
- data/lib/obfuscator/date_obfuscator.rb +4 -0
- data/lib/obfuscator/naturalizer.rb +4 -0
- data/lib/obfuscator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d62673f5b57f8d9a137fb1026beb43be38357f0f2ed7271f626f42a7649b94e
|
4
|
+
data.tar.gz: d1c4396db23eb14973609b7bc90743dbaca5dc6c22b3460c4ceabf8e428732e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9df173ba1df90c84d2a4b4ab3d94e0f4ef89b42fb6233f099d05a0cb725d9253e9f2dcc3022d3baa7972980672f77423cf0a52e823c4d6cb3cdd43165ff7b07
|
7
|
+
data.tar.gz: 2a04b22644bffdc49e88f6a4c691786d035f432a571ca60b7d7eb15364fb32969258b4b6a7379578702296dccd24c16237b1402b8485a8984ce03936c61e8943
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.3.2] - 2025-02-07
|
8
|
+
### Added
|
9
|
+
- Test coverage for the Naturalizer class core functionality
|
10
|
+
- Test for sequential deterministic behavior in DateObfuscator
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
- Restored proper deterministic behavior for DateObfuscator and Naturalizer when using seed
|
14
|
+
- Fixed test naming to follow Ruby conventions (ASCII identifiers)
|
15
|
+
- Renamed the `test_obfuscator.rb` file into `obfuscator_test.rb` to follow Ruby conventions
|
16
|
+
|
7
17
|
## [0.3.1] - 2025-02-07
|
8
18
|
### Fixed
|
9
19
|
- Restored proper deterministic behavior for sequential obfuscation calls when using seed
|
data/README.md
CHANGED
@@ -60,12 +60,16 @@ module Obfuscator
|
|
60
60
|
}.freeze
|
61
61
|
|
62
62
|
def initialize(format: :iso, seed: nil, constraints: {})
|
63
|
+
@seed = seed # Store the seed
|
63
64
|
setup_rng(seed)
|
64
65
|
@format = PRESET_FORMATS[format] || format
|
65
66
|
@constraints = default_constraints.merge(constraints)
|
66
67
|
end
|
67
68
|
|
68
69
|
def obfuscate(date_string)
|
70
|
+
# Reset RNG state before each obfuscation if seed was provided
|
71
|
+
setup_rng(@seed) if @seed
|
72
|
+
|
69
73
|
return date_string if date_string.nil? || date_string.empty?
|
70
74
|
|
71
75
|
begin
|
@@ -33,11 +33,15 @@ module Obfuscator
|
|
33
33
|
include Internal::RNG
|
34
34
|
|
35
35
|
def initialize(seed = nil)
|
36
|
+
@seed = seed # Store the seed
|
36
37
|
setup_rng(seed)
|
37
38
|
end
|
38
39
|
|
39
40
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength,Metrics/PerceivedComplexity
|
40
41
|
def naturalize(word)
|
42
|
+
# Reset RNG state before each naturalization if seed was provided
|
43
|
+
setup_rng(@seed) if @seed
|
44
|
+
|
41
45
|
return word unless word.respond_to?(:to_s)
|
42
46
|
return word if word.length < 2
|
43
47
|
|
data/lib/obfuscator/version.rb
CHANGED