zarby 0.2.0 → 0.2.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: 229aff347d8e56857376619b396c040a78af39f15914154e8bdaca9bbb326af2
4
- data.tar.gz: d4838dd23e8d3109c98a112f9ef2fbf16171c409a8c4b1c84b8a1cce421e6379
3
+ metadata.gz: 15991df79b92125212ac9c3aed7ad00ccff6b0ac848e459864b83462828b8541
4
+ data.tar.gz: 4abf5d1b86382b88db8e7cd52cdc0268dd60d29069e9dc0100a67c66fe3fdc30
5
5
  SHA512:
6
- metadata.gz: 587f9808e5c698b87194a130b26a4590c3dcaec119712d955e6ef1005e526f60e486e5a3318f16a197d4be8866f1c1ace8739aa2c74249ffa4e82eff9721dda6
7
- data.tar.gz: ac73ffb60b0e355f70f549a7392ce7e939701e8ea9a64c8e33464a9027fb00d97cb6ffd18c46b5de8e0659a4e756d75ede0828d4f2f1388a2fa6aa2c7c0e0ebe
6
+ metadata.gz: 50729ee39433894311be41f5e8796c376d8e1638978b008078c4a7a9b5dd81cd7f5bd5d089ab7df9cb078d59236575905b1584b809430eba9e1591d57d84917d
7
+ data.tar.gz: 5e5370b0ca6767a75970f292e40c41fda0954e2b65462a2b74f2d5c99d0611169c9745ec5ff6cab725a3b9ca4b0dc821bde0651afff3d2cc584ad75ebc1491f7
data/.rubocop.yml ADDED
@@ -0,0 +1,29 @@
1
+ # .rubocop.yml
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 3.3
5
+ NewCops: enable
6
+ Exclude:
7
+ - "vendor/**/*"
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Layout/LineLength:
13
+ Max: 100
14
+
15
+ Metrics/MethodLength:
16
+ Max: 15
17
+
18
+ Style/StringLiterals:
19
+ EnforcedStyle: double_quotes
20
+
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
23
+ EnforcedStyle: never
24
+
25
+ Metrics/AbcSize:
26
+ Max: 35
27
+
28
+ Layout/LineLength:
29
+ max: 120
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.3.3
1
+ ruby 3.3.8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 0.2.2 / 2026-08-20
2
+
3
+ ## Enhancements
4
+
5
+ * anonymise nil class, return nil class instead of raise exception
6
+
7
+
8
+ # 0.2.1 / 2026-08-20
9
+
10
+ ## Enhancements
11
+
12
+ * Perform anonymised email
13
+
1
14
  # 0.2.0 / 2024-06-28
2
15
 
3
16
  ## Enhancements
@@ -5,7 +18,7 @@
5
18
  * Poro class Csv and Normalize to symplify syntax
6
19
  * Csv and Normalize class will be private and their method depreciated
7
20
  * Use only instance of Zarby
8
- * Add module to anonymise string value.
21
+ * Add module to anonymize string value.
9
22
 
10
23
  # 0.1.5 / 2023-10-24
11
24
 
data/README.md CHANGED
@@ -14,42 +14,59 @@ Or install it yourself as:
14
14
 
15
15
  $ gem install zarby
16
16
 
17
+ ## WARNING
18
+ :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning:
19
+
20
+
21
+ V 0.1.6 (methods used wase depreciated and removed on 10/2024) for version (V 0.2.0)
22
+
23
+
24
+ :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning: :warning:
25
+
17
26
  ## Usage
18
27
 
19
28
  Three module are available: CSV, Normelize And Anonymize
20
29
 
21
30
  ### CSV
22
31
 
23
- Method do detecte delimiter in csv!
32
+ ```ruby
33
+ detect_separator(content|string)
34
+ ```
35
+
36
+ Method to detecte delimiter in csv!
24
37
 
25
- Since V 0.1.6 (depreciated and removed on 10/2024)
38
+ Since V 0.1.6 (depreciated and removed on 10/2024) :warning: :warning: :warning: :warning: :warning: :warning::warning: :warning: :warning:
26
39
 
27
40
  ```ruby
28
- Zarby::CSV.detect_delimiter("aa,bb,cc") # => ","
29
- Zarby::CSV.detect_delimiter("aa;bb;cc") # => ";"
30
- Zarby::CSV.detect_delimiter("aa,bb;cc,dd") # => ","
31
- Zarby::CSV.detect_delimiter("aa;bb;cc,dd") # => ";"
41
+ Zarby::Csv.detect_separator("aa,bb,cc") # => ","
42
+ Zarby::Csv.detect_separator("aa;bb;cc") # => ";"
43
+ Zarby::Csv.detect_separator("aa,bb;cc,dd") # => ","
44
+ Zarby::Csv.detect_separator("aa;bb;cc,dd") # => ";"
32
45
  ```
33
- Since V 0.1.7
46
+ Since V 0.1.7 :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes:
34
47
 
35
48
  ```ruby
36
- Zarby.detect_delimiter("aa,bb,cc") # => ","
37
- Zarby.detect_delimiter("aa;bb;cc") # => ";"
38
- Zarby.detect_delimiter("aa,bb;cc,dd") # => ","
39
- Zarby.detect_delimiter("aa;bb;cc,dd") # => ";"
49
+ Zarby.detect_separator("aa,bb,cc") # => ","
50
+ Zarby.detect_separator("aa;bb;cc") # => ";"
51
+ Zarby.detect_separator("aa,bb;cc,dd") # => ","
52
+ Zarby.detect_separator("aa;bb;cc,dd") # => ";"
40
53
  ```
41
54
 
42
- `detect_delimiter`, render the dilimter, define in a csv on XXXX ms.
55
+ `detect_separator`, render the separator, define in a csv on XXXX ms.
43
56
  `[',', ';', ':', '|']`, is available by default.
44
57
 
45
- ### Normelize
58
+ ### Normalize
59
+
60
+ ```ruby
61
+ utf8(input|string)
62
+ ```
46
63
 
47
64
  Method to utf8 encode all caracters in a string (since widows , sweden enoding, etc ...).
48
65
 
49
- Since V 0.1.6 (depreciated and removed on 10/2024)
66
+ Since V 0.1.6 (depreciated and removed on 10/2024) :warning: :warning: :warning: :warning: :warning: :warning::warning: :warning: :warning:
50
67
 
51
68
  ```ruby
52
- Zarby.utf8("Aa\xFCAa\xDF".force_encoding('Windows-1252')) # => "AaüAaß
69
+ Zarby::Normalize.utf8("Aa\xFCAa\xDF".force_encoding('Windows-1252')) # => "AaüAaß
53
70
  # actually Windows-1252
54
71
  Zarby::Normalize.utf8("Aa\xFCAa\xDF".force_encoding('ASCII-8BIT')) # => "AaüAaß"
55
72
  # actually Windows-1252
@@ -59,7 +76,7 @@ Zarby::Normalize.utf8("Aa\x80Aa\x81".force_encoding('ASCII-8BIT')) # => "AaüAa
59
76
 
60
77
  ```
61
78
 
62
- Since V 0.1.7
79
+ Since V 0.1.7 :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes:
63
80
 
64
81
  ```ruby
65
82
  Zarby.utf8("Aa\xFCAa\xDF".force_encoding('Windows-1252')) # => "AaüAaß
@@ -72,39 +89,45 @@ Zarby.utf8("Aa\x80Aa\x81".force_encoding('ASCII-8BIT')) # => "AaüAaß"
72
89
 
73
90
  ```
74
91
 
75
- ### Anonymise
92
+ ### Anonymize
93
+
94
+ ```ruby
95
+ anonymize(input|string, nb_chars|int \ 2, mask_with|string \ '*')
96
+ ```
76
97
 
77
- Method to anonymise a string.
98
+ Method to anonymize a string.
78
99
 
79
100
  ```ruby
80
- Zarby.anonymise("z") # => "**"
81
- Zarby.anonymise("za") # => "**"
82
- Zarby.anonymise("zar") # => "z*r"
83
- Zarby.anonymise("zarb") # => "z**b"
84
- Zarby.anonymise("zarby") # => "za*by"
85
- arby.anonymise("mewtwo") # => "me**wo"
86
- arby.anonymise("Ectoplasma") # => "Ec******ma"
101
+ Zarby.anonymize("z") # => "**"
102
+ Zarby.anonymize("za") # => "**"
103
+ Zarby.anonymize("zar") # => "z*r"
104
+ Zarby.anonymize("zarb") # => "z**b"
105
+ Zarby.anonymize("zarby") # => "za*by"
106
+ Zarby.anonymize("mewtwo") # => "me**wo"
107
+ Zarby.anonymize("Ectoplasma") # => "Ec******ma"
87
108
  ```
88
109
 
89
- `anonymise` try to set '*' between two first and two last letter of the string if lenght greater than 4.
110
+ `anonymize` try to set '\*' between two first and two last letter of the string if lenght greater than 4.
90
111
  if string length between 1 to 2, return **.
91
112
  if string length = 3 return a*a.
92
113
  if string length = 4 return a**a.
93
114
 
94
- if "@" is present, render `anonymise` string before and after "@", and kept "@" symbole.
115
+ if "@" is present, render `anonymize` string before and after "@", and kept "@" symbole.
95
116
  exemple:
96
117
 
97
118
  ```ruby
98
- Zarby.anonymise("z@z") # => "**@**"
99
- Zarby.anonymise("za@za") # => "**@**"
100
- Zarby.anonymise("zar@zar") # => "z*r@z*r"
101
- Zarby.anonymise("zarb@zarb") # => "z**b@z**b"
102
- Zarby.anonymise("zarby@zarby") # => "za*by@za*by"
103
- Zarby.anonymise("mewtwo@mewtwo") # => "me**wo@me**wo"
104
- Zarby.anonymise("Ectoplasma@Ectoplasma") # => "Ec******ma@Ec******ma"
105
- # Using multiple "@"
106
- Zarby.anonymise("pichu@pikachu@raichu") # => "pi*hu@pi***hu@ra**hu"
107
- Zarby.anonymise("@fantominus@spectrum@ectoplasma@") # => "**@fa******us@sp****um@ec******ma"
119
+ Zarby.anonymize("z@z") # => "**@**"
120
+ Zarby.anonymize("za@za") # => "**@**"
121
+ Zarby.anonymize("zar@zar") # => "z*r@z*r"
122
+ Zarby.anonymize("zarb@zarb") # => "z**b@z**b"
123
+ Zarby.anonymize("zarby@zarby") # => "za*by@za*by"
124
+ Zarby.anonymize("mewtwo@mewtwo") # => "me**wo@me**wo"
125
+ Zarby.anonymize("Ectoplasma@Ectoplasma") # => "Ec******ma@Ec******ma"
126
+
127
+ ## Using multiple "@"
128
+
129
+ Zarby.anonymize("pichu@pikachu@raichu") # => "pi*hu@pi***hu@ra**hu"
130
+ Zarby.anonymize("@fantominus@spectrum@ectoplasma@") # => "**@fa******us@sp****um@ec******ma"
108
131
  ```
109
132
 
110
133
  ## Contributing
data/gem_info.txt CHANGED
@@ -9,3 +9,4 @@ c est que je n ai pas la gem rspec de cette version de ruby
9
9
 
10
10
  ## PUSH GEM ##
11
11
 
12
+ gem build zarby.gemspec
@@ -1,42 +1,52 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zarby
4
- # this class is used to anonymise string on replace char with *
4
+ # this class is used to anonymize string on replace char with *
5
5
  class Anonymize
6
- def initialize(input: , nb_chars: 2, mask_with: '*')
6
+ def initialize(input:, nb_chars: 2, mask_with: "*")
7
7
  @input = input
8
8
  @nb_chars = nb_chars
9
9
  @mask_with = mask_with
10
+
11
+ validate!
10
12
  end
11
13
 
12
14
  # @return [String]
13
15
  def call
14
- raise ArgumentError, "nb_chars must be greater then or equal to zero" if @nb_chars.negative?
16
+ return if @input.nil?
17
+ return anonymize_email if email?
15
18
 
16
- @input.include?("@") ? with_comercial_at : with_default_chars(@input)
19
+ anonymize_segment(@input)
17
20
  end
18
21
 
19
22
  private
20
23
 
21
- # @param input [String]
22
- # @return [String]
23
- def with_default_chars(input)
24
- if input.length < 3
25
- "**"
26
- elsif input.length <= @nb_chars * 2
27
- @nb_chars -= 1
28
- with_default_chars(input)
29
- else
30
- input.sub(
31
- /\A(.{#{@nb_chars}})(.*)(.{#{@nb_chars}})\z/,
32
- "\\1#{@mask_with * (input.length - (@nb_chars * 2))}\\3"
33
- )
34
- end
24
+ def anonymize_email
25
+ local, domain = @input.split("@", 2)
26
+ domain_name, tld = domain.split(".", 2)
27
+
28
+ "#{anonymize_segment(local)}@#{anonymize_segment(domain_name)}.#{tld}"
35
29
  end
36
30
 
37
- # @return [String]
38
- def with_comercial_at
39
- @input.split("@").map{ |v| with_default_chars(v) }.join("@")
31
+ def anonymize_segment(input, nbr = @nb_chars)
32
+ return @mask_with * 2 if input.length < 3
33
+
34
+ return anonymize_segment(input, nbr - 1) if input.length <= nbr * 2 && nbr.positive?
35
+
36
+ prefix = input[0, nbr]
37
+ suffix = input[-nbr, nbr]
38
+ masked = @mask_with * (input.length - (nbr * 2))
39
+
40
+ prefix + masked + suffix
41
+ end
42
+
43
+ def email?
44
+ @input.match?(/\A[^\s@]+@[^\s@]+\.[^\s@]+\z/)
45
+ end
46
+
47
+ def validate!
48
+ raise Zarby::ArgumentZarby, "mask_with must be a String" unless @mask_with.is_a?(String)
49
+ raise Zarby::ArgumentZarby, "nb_chars must be >= 0" if @nb_chars.negative?
40
50
  end
41
51
  end
42
52
  end
data/lib/zarby/csv.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zarby
4
- class NoColSepDetected < StandardError; end
5
-
6
4
  # this class is used to detect the column separator in a CSV file
7
5
  class Csv
8
6
  extend Gem::Deprecate
@@ -12,29 +10,19 @@ module Zarby
12
10
  # @param [String] content
13
11
  # @return [Csv]
14
12
  def initialize(content:)
15
- @content = content || ""
13
+ @content = content.to_s.each_line.first.to_s.strip
16
14
  end
17
15
 
18
16
  # @return [String]
19
17
  def call
20
- valid? ? delimiters[0][0][1] : raise(Zarby::NoColSepDetected)
21
- end
22
-
23
- # @return [String]
24
- def detect_separator
25
- valid? ? delimiters[0][0][1] : raise(Zarby::NoColSepDetected)
26
- end
27
- deprecate :detect_separator, 'Zarby#detect_separator(.string)', 2024, 10
28
-
29
- class << self
30
- # @param [String] content
31
- # @return [String]
32
- def detect_separator(content)
33
- new(content: content).detect_separator
18
+ if valid?
19
+ delimiters[0][0][1]
20
+ else
21
+ raise(Zarby::ColSeparatorZarby,
22
+ "The content to be analyzed must have one of this list as a delimiter: ',' ';' ':' '|'")
34
23
  end
35
24
  end
36
25
 
37
-
38
26
  private
39
27
 
40
28
  # @return [Boolean]
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zarby
4
+ class ColSeparatorZarby < StandardError; end
5
+ class ArgumentZarby < StandardError; end
6
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+
5
+ module Zarby
6
+ module Functions
7
+ def zp(*_args)
8
+ IO.console.winsize
9
+ puts location caller_locations.first
10
+ end
11
+
12
+ def location(call_loc)
13
+ " ⓩ Ⓐ Ⓡ Ⓑ ⓟ Ⓡ ⓘ ⓝ Ⓣ - from: #{name}##{call_loc.label} (in #{project_path call_loc.path}, at line: #{call_loc.lineno})" # rubocop:disable Layout/LineLength
14
+ end
15
+
16
+ def project_path(full_path)
17
+ root_path = Rails.root.nil? ? File.expand_path("../../..", __dir__) : Rails.root.to_s
18
+ full_path.sub "#{root_path}/", ""
19
+ end
20
+ end
21
+ end
@@ -3,37 +3,25 @@
3
3
  module Zarby
4
4
  # this class is used to normalize the input string to UTF-8
5
5
  class Normalize
6
- extend Gem::Deprecate
7
-
8
6
  # utf-8 converting from the string's given encoding
9
7
  COMMON_ENCODINGS = %w[UTF-8 Windows-1252 ASCII-8BIT ISO-8859-1 US-ASCII].freeze
10
8
 
11
9
  # @param input [String]
12
10
  # @return [String]
13
11
  def initialize(input:)
14
- @input = input&.force_encoding(Encoding::UTF_8) || ''
15
- end
16
-
17
- # @return [String]
18
- def call
19
- output = @input if valid?
20
-
12
+ unless input.is_a?(String)
13
+ raise Zarby::ArgumentZarby, "input to normalise utf8 must be of type String, #{input.class} given"
14
+ end
21
15
 
22
- output ||= @input.force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)
23
- rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
24
- nil
16
+ @input = input&.force_encoding(Encoding::UTF_8) || ""
25
17
  end
26
18
 
27
19
  # @return [String]
28
- def utf8
29
- output = @input if valid?
30
-
20
+ def call
21
+ return @input if valid?
31
22
 
32
- output ||= @input.force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)
33
- rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
34
- nil
23
+ @input.dup.force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)
35
24
  end
36
- deprecate :utf8, 'Zarby#utf8(.string)', 2024, 10
37
25
 
38
26
  class << self
39
27
  # @param input [String]
@@ -47,7 +35,7 @@ module Zarby
47
35
 
48
36
  # @return [Boolean]
49
37
  def valid?
50
- @input.encoding.name == 'UTF-8' && @input.valid_encoding?
38
+ @input.encoding.name == "UTF-8" && @input.valid_encoding?
51
39
  end
52
40
  end
53
41
  end
data/lib/zarby/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zarby
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/zarby.rb CHANGED
@@ -1,23 +1,55 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'zarby/version'
4
- require_relative 'zarby/csv'
5
- require_relative 'zarby/normalize'
6
- require_relative 'zarby/anonymize'
1
+ require_relative "zarby/anonymize"
2
+ require_relative "zarby/csv"
3
+ require_relative "zarby/errors"
4
+ require_relative "zarby/functions"
5
+ require_relative "zarby/normalize"
6
+ require_relative "zarby/version"
7
7
 
8
8
  module Zarby
9
- def anonymise(input, nb_chars: 2, mask_with: '*')
10
- Anonymize.new(input:, nb_chars: nb_chars, mask_with: mask_with).call
9
+ def plop
10
+ zp "coucou ca va?"
11
+ puts inspect
12
+ puts self.class.inspect
13
+ puts self.class.name
14
+ end
15
+
16
+ class Foo
17
+ def self.plop
18
+ zp "ijijij"
19
+ end
11
20
  end
12
21
 
22
+ # Anonymizes a given input by masking the first `nb_chars` characters with `mask_with`.
23
+ #
24
+ # @param input [String] The string input to be anonymized.
25
+ # @param nb_chars [Integer] The number of characters from the input to be masked. Default is 2.
26
+ # @param mask_with [String] The character to mask the input with. Default is '*'.
27
+ # @return [String] The anonymized string with masked characters.
28
+ def anonymize(input, nb_chars: 2, mask_with: "*")
29
+ Anonymize.new(input:, nb_chars:, mask_with:).call
30
+ end
31
+
32
+ # Detects and returns the separator used in the provided CSV content.
33
+ #
34
+ # @param content [String] The CSV content to detect the separator for.
35
+ # @return [String] The detected separator (e.g., ',' or ';').
13
36
  def detect_separator(content)
14
37
  Csv.new(content:).call
15
38
  end
16
39
 
40
+ # Normalizes the input string to UTF-8 encoding.
41
+ #
42
+ # @param input [String] The input string to normalize.
43
+ # @return [String] The normalized string in UTF-8 encoding.
17
44
  def utf8(input)
18
45
  Normalize.new(input:).call
19
46
  end
20
47
 
21
- module_function :anonymise, :detect_separator, :utf8
48
+ # Expose methods as module functions for easy use without needing to instantiate.
49
+ module_function :anonymize, :detect_separator, :utf8, :plop
50
+
51
+ # Prevents direct access to the Anonymize class outside the module.
22
52
  private_constant :Anonymize
23
53
  end
54
+
55
+ module Kernel; include Zarby::Functions; end # rubocop:disable Style/OneClassPerFile
data/zarby.gemspec CHANGED
@@ -10,15 +10,16 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "String encoding and decoding with Ruby."
12
12
  # spec.description = "TODO: Write a longer description or delete this line."
13
- spec.homepage = "https://guides.rubygems.org"
13
+ spec.homepage = "https://rubygems.org/gems/zarby"
14
14
  spec.required_ruby_version = ">= 2.6.0"
15
- spec.licenses = ['MIT']
15
+ spec.licenses = ["MIT"]
16
16
 
17
- spec.metadata = {
18
- "source_code_uri" => "https://github.com/VianneySonneville/zarby",
19
- "changelog_uri" => "https://github.com/VianneySonneville/zarby/blob/main/CHANGELOG.md"
17
+ spec.metadata = {
18
+ "source_code_uri" => "https://github.com/VianneySonneville/zarby",
19
+ "changelog_uri" => "https://github.com/VianneySonneville/zarby/blob/main/CHANGELOG.md",
20
+ "rubygems_mfa_required" => "true",
21
+ "allowed_push_host" => "https://rubygems.org"
20
22
  }
21
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
22
23
 
23
24
  # spec.metadata["homepage_uri"] = spec.homepage
24
25
  # spec.metadata["source_code_uri"] = spec.homepage
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zarby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vianney.sonneville
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2026-08-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - vianneysonneville4@gmail.com
16
16
  executables: []
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".env"
21
+ - ".rubocop.yml"
21
22
  - ".tool-versions"
22
23
  - CHANGELOG.md
23
24
  - LICENSE
@@ -27,9 +28,9 @@ files:
27
28
  - lib/zarby.rb
28
29
  - lib/zarby/anonymize.rb
29
30
  - lib/zarby/csv.rb
30
- - lib/zarby/img/ceapl.svg
31
+ - lib/zarby/errors.rb
32
+ - lib/zarby/functions.rb
31
33
  - lib/zarby/normalize.rb
32
- - lib/zarby/typo/zarby.ttf
33
34
  - lib/zarby/version.rb
34
35
  - sig/zarby.rbs
35
36
  - zarby-0.1.0.gem
@@ -40,14 +41,15 @@ files:
40
41
  - zarby-0.1.5.gem
41
42
  - zarby-0.1.6.gem
42
43
  - zarby.gemspec
43
- homepage: https://guides.rubygems.org
44
+ homepage: https://rubygems.org/gems/zarby
44
45
  licenses:
45
46
  - MIT
46
47
  metadata:
47
48
  source_code_uri: https://github.com/VianneySonneville/zarby
48
49
  changelog_uri: https://github.com/VianneySonneville/zarby/blob/main/CHANGELOG.md
50
+ rubygems_mfa_required: 'true'
49
51
  allowed_push_host: https://rubygems.org
50
- post_install_message:
52
+ post_install_message:
51
53
  rdoc_options: []
52
54
  require_paths:
53
55
  - lib
@@ -62,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
64
  - !ruby/object:Gem::Version
63
65
  version: '0'
64
66
  requirements: []
65
- rubygems_version: 3.5.14
66
- signing_key:
67
+ rubygems_version: 3.5.22
68
+ signing_key:
67
69
  specification_version: 4
68
70
  summary: String encoding and decoding with Ruby.
69
71
  test_files: []
@@ -1,15 +0,0 @@
1
- <svg width="1544" height="255" viewBox="0 0 1544 255" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M285.127 199.975C267.153 199.975 251.426 196.606 237.945 189.867C224.652 182.942 214.26 173.583 206.771 161.791C199.469 149.811 195.818 136.241 195.818 121.079C195.818 105.918 199.375 92.441 206.49 80.6488C213.792 68.6693 223.809 59.404 236.541 52.8527C249.273 46.1143 263.596 42.7451 279.511 42.7451C294.489 42.7451 308.157 45.8336 320.514 52.0105C332.872 58.0002 342.701 66.8911 350.003 78.6834C357.305 90.4756 360.956 104.795 360.956 121.641C360.956 123.513 360.863 125.665 360.676 128.098C360.488 130.532 360.301 132.778 360.114 134.837H249.514L248.733 106.76H311.033H331.748H316.461C316.461 106.76 313.199 106.76 311.033 106.76C310.426 103.054 309.28 99.6848 307.595 96.6525C304.974 91.5987 301.229 87.6679 296.361 84.8602C291.681 82.0526 286.157 80.6488 279.791 80.6488C273.426 80.6488 267.809 82.0526 262.941 84.8602C258.26 87.6679 254.609 91.6923 251.987 96.9333C249.366 101.987 248.056 107.977 248.056 114.902V123.045C248.056 130.532 249.553 136.989 252.549 142.418C255.732 147.846 260.226 152.057 266.03 155.052C271.834 157.86 278.762 159.264 286.813 159.264C294.302 159.264 300.668 158.234 305.91 156.175C311.34 153.929 316.676 150.56 321.919 146.068L350.003 175.267C342.701 183.316 333.714 189.493 323.042 193.798C312.37 197.916 299.732 199.975 285.127 199.975Z" fill="#0A6C49"/>
3
- <path d="M463.354 199.975C446.503 199.975 431.431 196.606 418.137 189.867C405.031 183.129 394.733 173.864 387.244 162.071C379.755 150.092 376.01 136.428 376.01 121.079C376.01 105.731 379.755 92.1602 387.244 80.368C394.733 68.5757 405.031 59.404 418.137 52.8527C431.431 46.1143 446.503 42.7451 463.354 42.7451C480.579 42.7451 495.464 46.3951 508.009 53.6951C520.553 60.995 529.447 71.2898 534.689 84.5795L493.405 105.637C489.847 98.5243 485.447 93.3769 480.205 90.1948C474.962 86.8256 469.252 85.141 463.073 85.141C456.894 85.141 451.278 86.5449 446.222 89.3525C441.167 92.1602 437.142 96.2781 434.146 101.706C431.337 106.947 429.933 113.405 429.933 121.079C429.933 128.941 431.337 135.586 434.146 141.014C437.142 146.442 441.167 150.56 446.222 153.368C451.278 156.175 456.894 157.579 463.073 157.579C469.252 157.579 474.962 155.988 480.205 152.806C485.447 149.437 489.847 144.196 493.405 137.083L534.689 158.141C529.447 171.43 520.553 181.725 508.009 189.025C495.464 196.325 480.579 199.975 463.354 199.975Z" fill="#0A6C49"/>
4
- <path d="M578.157 254.444C570.106 254.444 561.962 253.134 553.723 250.513C545.672 248.08 539.119 244.804 534.064 240.686L552.6 203.344C555.783 206.152 559.434 208.304 563.553 209.802C567.859 211.486 572.072 212.329 576.191 212.329C581.995 212.329 586.583 211.019 589.953 208.398C593.323 205.778 596.225 201.66 598.659 196.044L605.68 178.356L609.893 173.021L661.569 45.272H712.402L646.684 203.625C641.442 216.727 635.356 226.929 628.429 234.229C621.689 241.716 614.106 246.957 605.68 249.952C597.442 252.947 588.268 254.444 578.157 254.444Z" fill="#0A6C49"/>
5
- <path d="M531.818 45.2744L598.94 203.908L636.012 168.251L586.583 45.2744H531.818Z" fill="#0A6C49"/>
6
- <path d="M1488.37 138.623H1544L1534.88 194.254H1479.25L1488.37 138.623Z" fill="#E16253"/>
7
- <rect x="244.414" y="106.703" width="5.47194" height="28.2717" fill="#0A6C49"/>
8
- <path fill-rule="evenodd" clip-rule="evenodd" d="M75.4254 128.624L72.8784 124.9H132.248L138.981 134.687C138.156 135.083 137.317 135.47 136.466 135.845C127.088 139.913 116.379 142.507 104.341 143.627L101.982 147.009L75.4254 128.624ZM97.0459 160.23L97.4436 160.505C99.9573 162.245 102.899 163.263 105.95 163.451C109.001 163.638 112.045 162.987 114.753 161.569C117.461 160.15 119.729 158.018 121.312 155.403C121.429 155.209 121.542 155.014 121.651 154.817C128.798 153.276 135.562 151.149 141.91 148.396L141.952 148.377L141.994 148.359C143.636 147.634 145.243 146.872 146.816 146.075L181.489 196.472H121.837L97.0459 160.23Z" fill="#0A6C49"/>
9
- <path fill-rule="evenodd" clip-rule="evenodd" d="M0 196.471V0H90.0395C108.047 0 123.523 2.90029 136.466 8.70086C149.597 14.5014 159.726 22.9216 166.854 33.9614C173.983 44.8141 177.547 57.7251 177.547 72.6943C177.547 87.4764 173.983 100.294 166.854 111.146C159.726 121.812 149.597 130.045 136.466 135.846C128.598 139.258 119.793 141.633 110.053 142.971V146.728C110.053 147.289 109.899 147.839 109.609 148.319C109.318 148.799 108.902 149.191 108.405 149.451C107.908 149.712 107.349 149.831 106.789 149.797C106.229 149.762 105.689 149.575 105.227 149.256L65.244 121.575C64.8367 121.291 64.504 120.913 64.2743 120.472C64.0446 120.032 63.9246 119.542 63.9246 119.046C63.9246 118.549 64.0446 118.059 64.2743 117.619C64.504 117.179 64.8367 116.8 65.244 116.516L105.227 88.8351C105.689 88.5157 106.229 88.3287 106.79 88.2944C107.35 88.2601 107.909 88.3799 108.406 88.6406C108.903 88.9014 109.319 89.2933 109.61 89.7737C109.9 90.2542 110.053 90.805 110.053 91.3664V95.6887C110.942 95.0887 111.774 94.4407 112.549 93.7447C118.364 88.6926 121.272 81.6758 121.272 72.6943C121.272 63.5256 118.364 56.4153 112.549 51.3631C106.922 46.311 98.2931 43.785 86.663 43.785H55.7119V101.323V144.266V196.471H0Z" fill="#0A6C49"/>
10
- <path d="M815.969 193.765C804.567 193.765 794.656 191.565 786.237 187.167C777.817 182.592 771.677 175.291 767.818 165.262C763.959 155.233 763.082 141.862 765.187 125.147C766.941 108.785 770.713 94.7093 776.501 82.9211C782.465 71.133 790.183 62.072 799.656 55.7381C809.303 49.2282 820.442 45.9733 833.072 45.9733C843.421 45.9733 853.157 48.5245 862.278 53.6268C871.575 58.7291 879.03 66.1187 884.644 75.7955C890.432 85.2964 893.326 96.9965 893.326 110.896C893.326 122.86 891.309 133.856 887.275 143.885C883.24 153.914 877.627 162.711 870.435 170.276C863.418 177.666 855.262 183.472 845.965 187.695C836.668 191.741 826.669 193.765 815.969 193.765ZM708.616 242.589L747.295 48.3485H794.656L789.657 72.3646L780.448 119.605L773.87 166.582L758.609 242.589H708.616ZM808.865 153.386C815.531 153.386 821.407 151.714 826.494 148.372C831.581 145.029 835.528 140.366 838.334 134.384C841.316 128.402 842.807 121.452 842.807 113.535C842.807 105.266 840.439 98.668 835.703 93.7416C830.967 88.6393 824.301 86.0881 815.706 86.0881C809.216 86.0881 803.339 87.8475 798.077 91.3664C792.99 94.7093 788.956 99.3717 785.974 105.354C783.167 111.336 781.764 118.285 781.764 126.203C781.764 134.472 784.132 141.07 788.868 145.996C793.604 150.923 800.27 153.386 808.865 153.386Z" fill="#E16253"/>
11
- <path d="M966.819 193.765C956.645 193.765 946.91 191.213 937.613 186.111C928.316 181.009 920.773 173.619 914.985 163.942C909.371 154.266 906.565 142.478 906.565 128.578C906.565 116.614 908.582 105.618 912.616 95.589C916.651 85.5603 922.176 76.8511 929.193 69.4616C936.385 62.072 944.629 56.3539 953.926 52.3072C963.399 48.0846 973.397 45.9733 983.922 45.9733C995.499 45.9733 1005.41 48.2606 1013.65 52.835C1022.07 57.2336 1028.21 64.4472 1032.07 74.4759C1035.93 84.3287 1036.81 97.7003 1034.7 114.591C1033.13 130.601 1029.35 144.589 1023.39 156.553C1017.43 168.517 1009.71 177.754 1000.24 184.264C990.763 190.598 979.624 193.765 966.819 193.765ZM984.185 153.386C990.851 153.386 996.727 151.714 1001.81 148.372C1006.9 145.029 1010.85 140.366 1013.65 134.384C1016.64 128.402 1018.13 121.452 1018.13 113.535C1018.13 105.266 1015.76 98.668 1011.02 93.7416C1006.29 88.6393 999.621 86.0881 991.026 86.0881C984.536 86.0881 978.66 87.8475 973.397 91.3664C968.31 94.7093 964.276 99.3717 961.294 105.354C958.487 111.336 957.084 118.285 957.084 126.203C957.084 134.472 959.452 141.07 964.188 145.996C968.924 150.923 975.59 153.386 984.185 153.386ZM1005.23 191.389L1010.23 167.373L1019.71 120.133L1026.02 72.8924L1031.02 48.3485H1081.01L1052.6 191.389H1005.23Z" fill="#E16253"/>
12
- <path d="M1084.78 191.389L1113.2 48.3485H1160.56L1152.4 88.9911L1147.66 77.379C1153.98 65.9427 1162.31 57.8494 1172.66 53.099C1183.01 48.3485 1195.11 45.9733 1208.97 45.9733L1200.29 91.1024C1198.18 90.7506 1196.25 90.5746 1194.5 90.5746C1192.75 90.3987 1190.9 90.3107 1188.97 90.3107C1178.1 90.3107 1169.15 92.9498 1162.14 98.2281C1155.3 103.33 1150.73 111.864 1148.45 123.828L1134.77 191.389H1084.78Z" fill="#E16253"/>
13
- <path d="M1268.44 193.765C1257.39 193.765 1247.92 191.653 1240.02 187.431C1232.13 183.032 1226.52 176.698 1223.18 168.429C1219.85 159.984 1219.32 149.955 1221.6 138.343L1245.81 16.415H1295.8L1271.6 138.079C1270.72 143.533 1271.33 147.756 1273.44 150.747C1275.54 153.562 1279.14 154.969 1284.23 154.969C1286.86 154.969 1289.4 154.618 1291.86 153.914C1294.31 153.21 1296.77 152.154 1299.22 150.747L1305.54 185.319C1300.28 188.31 1294.4 190.422 1287.91 191.653C1281.6 193.061 1275.1 193.765 1268.44 193.765ZM1210.03 91.1024L1217.66 53.6268H1320.8L1313.43 91.1024H1210.03Z" fill="#E16253"/>
14
- <path d="M1378.76 193.765C1366.13 193.765 1354.2 192.445 1342.97 189.806C1331.75 186.991 1323.06 183.648 1316.92 179.777L1335.08 144.677C1341.74 148.899 1349.55 152.154 1358.5 154.442C1367.44 156.729 1376.12 157.872 1384.54 157.872C1392.79 157.872 1398.67 156.993 1402.17 155.233C1405.68 153.298 1407.44 150.747 1407.44 147.58C1407.44 144.765 1405.59 142.741 1401.91 141.51C1398.4 140.102 1393.84 138.959 1388.23 138.079C1382.62 137.199 1376.65 136.056 1370.34 134.648C1364.2 133.241 1358.32 131.217 1352.71 128.578C1347.09 125.939 1342.45 122.244 1338.76 117.494C1335.25 112.567 1333.5 106.058 1333.5 97.9642C1333.5 86.528 1336.83 76.9391 1343.5 69.1977C1350.16 61.4562 1359.2 55.6501 1370.6 51.7794C1382.18 47.9087 1395.16 45.9733 1409.54 45.9733C1419.72 45.9733 1429.54 46.941 1439.01 48.8764C1448.48 50.8117 1456.73 53.6268 1463.74 57.3216L1446.11 92.422C1439.1 88.1994 1431.91 85.3843 1424.54 83.9768C1417.17 82.3933 1410.24 81.6016 1403.75 81.6016C1395.51 81.6016 1389.63 82.6572 1386.12 84.7685C1382.62 86.8798 1380.86 89.431 1380.86 92.422C1380.86 95.0611 1382.62 97.1725 1386.12 98.7559C1389.81 100.163 1394.37 101.395 1399.81 102.451C1405.42 103.33 1411.38 104.474 1417.7 105.882C1424.01 107.113 1429.89 109.049 1435.33 111.688C1440.94 114.327 1445.5 118.022 1449.01 122.772C1452.69 127.522 1454.53 133.944 1454.53 142.038C1454.53 153.298 1451.11 162.799 1444.27 170.54C1437.61 178.282 1428.57 184.088 1417.17 187.959C1405.77 191.829 1392.96 193.765 1378.76 193.765Z" fill="#E16253"/>
15
- </svg>
Binary file