dorian-anonymize 0.2.0 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/anonymize +10 -7
  3. metadata +19 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d4f8f5bb014dd3511eda7278c862c9bae8eae959ad2966a58addfcc4c51b9f7
4
- data.tar.gz: 131bafe5d511382001fc3b6156133f12241a62b10d5f01974cd5e67b1653d37e
3
+ metadata.gz: 1c88ef05866f071e6d65fcc40bd1a9365d1ef016877c10062cba62d212b0348f
4
+ data.tar.gz: 81b436be6dfb347274a1784273928179993efee05300e52762af76a54402f16a
5
5
  SHA512:
6
- metadata.gz: 9dc6d2a02e8f9a0ff6a9775d1a4b656dcc8ef84b7c637b17f6f64bb6e29237e511f08d2aca2e4a68c18a8d64a09cd0ab5e1fa6c10e4c4b97a478cebd0ffb1e88
7
- data.tar.gz: 8c0a4f7384fcc14c8b3075a4986de0061f92cec12bd69ba469171882dc3c28b15c160fbcc8ed12a17c4be88a5c084902f801725750c632ca223786f5b6d7bce4
6
+ metadata.gz: 4a81f3e5d4f238e5299a9c8846c20d762e9922359f98b2dce9aa4171a44a50323da7aa416da9e50cbea78f994f4376341a48978a207eb03c56c548e4fddf5c30
7
+ data.tar.gz: a01a214d2a85216825c7796be7287cb05764bd0eceaaca0f93cb17a045a7cf20541d791e3025fd615d9da29fed78b7d8b3d41782a6ff10e0cbf47a79e9e857f9
data/bin/anonymize CHANGED
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if ARGV[0] == "--help" || ARGV[0] == "-h"
5
- puts "USAGE: anonymize STRINGS..."
6
- puts "USAGE: ... | anonymize"
7
- exit
8
- end
4
+ require "dorian/arguments"
5
+
6
+ parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
9
7
 
10
- inputs = ARGV
8
+ abort parsed.help if parsed.options.help
9
+
10
+ if parsed.options.version
11
+ abort File.read(File.expand_path("../../VERSION", __FILE__))
12
+ end
11
13
 
12
- inputs = $stdin.each_line.to_a if inputs.empty?
14
+ inputs = parsed.arguments + parsed.files.map { |file| File.read(file) }
15
+ inputs = $stdin.each_line.to_a.map(&:strip) if inputs.empty?
13
16
 
14
17
  inputs.each do |input|
15
18
  puts input.to_s.gsub(/[0-9]/, "0").gsub(/[a-z]/, "a").gsub(/[A-Z]/, "A")
metadata CHANGED
@@ -1,19 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-anonymize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
12
- dependencies: []
13
- description: |-
14
- Anonymize strings
15
-
16
- e.g. `anonymize mySecret1234`
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dorian-arguments
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: anonymize strings
17
28
  email: dorian@dorianmarie.com
18
29
  executables:
19
30
  - anonymize
@@ -44,5 +55,5 @@ requirements: []
44
55
  rubygems_version: 3.5.11
45
56
  signing_key:
46
57
  specification_version: 4
47
- summary: Anonymize strings
58
+ summary: anonymize strings
48
59
  test_files: []