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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 631dc474ce83763052076cc0859f85012e0e79a623d4394ffc1485152d92ae41
4
- data.tar.gz: 0b6f3963a2f67f29f4f84ea226f181331a77802bfdab22046b802c5ea9df82ab
3
+ metadata.gz: 2d62673f5b57f8d9a137fb1026beb43be38357f0f2ed7271f626f42a7649b94e
4
+ data.tar.gz: d1c4396db23eb14973609b7bc90743dbaca5dc6c22b3460c4ceabf8e428732e3
5
5
  SHA512:
6
- metadata.gz: 694433e45c631fc851840d63af7f8dceff5d77da72b28a0818a3cbb5001c9456e55c45c10d3597e53b6b55e7a6eb29bc1aada13edad2ded2f53a85bf906458fc
7
- data.tar.gz: d7bcd0e7b17e725c782a92a9ed865c7f78dc03e9b7afd8d10afe3725cf4a46080839e3abcd5fe756fd18853b74a7db96f572ec3e483ae10b5f67eaa1c8e9dbcc
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
@@ -1,5 +1,7 @@
1
1
  # Obfuscator
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/obfuscator-rb.svg)](https://badge.fury.io/rb/obfuscator-rb)
4
+
3
5
  [Русский](#русский) | [English](#english)
4
6
 
5
7
  ## Русский
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Obfuscator
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obfuscator-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksandr Dryzhuk