dorian-anonymize 0.2.2 → 1.0.0

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 +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72bab8adf51d155d9e10e238b481ba3ef256e9d81b9f1deccd3c30baccf257b2
4
- data.tar.gz: 00b024962dcc6a2ed3185a7ac3e3fd57831cef06bdeb64e1685bb083679bb296
3
+ metadata.gz: df1f2f0c8ee75cbdf4fe9ceba495aec1e5410ddefeb940af0ad5f0f7fdd9419d
4
+ data.tar.gz: f973ac03d384c5ca694c4fe4fb20d0b271d4a4b3a8464eb531ef41b20e7524ab
5
5
  SHA512:
6
- metadata.gz: d58f33a0bfa56784fd3ed73cb8686f69a5b5e9d3c1f62f9f0eb3967a198319d8652acd716710edcbb0c7a85f2eca346b20fd714ab3cd758c6034c11b69cef0ce
7
- data.tar.gz: 291f7a6a1a0c1b6f89f24990ea748d3ad3992294d0f40baf4b3c7b3b747c6db44282497294c637b4e33d65335b70623940abd27b529316297365e52f5544e209
6
+ metadata.gz: fa9dccbfa0ec3e782f83e0c412bb44be2786e1c69e4720b7b1b40f24aaabd9f5d3a89b9ae579272bdb0eab943821552a8a8c633fc2938af68c2582fd20d4861c
7
+ data.tar.gz: fce5bd9d9dc3be91219c90388eb852494e1ec935faf39f5b9370fd89b94a91552804bd6365f59a145b7b392a3aef04c49a10bc67d378dfc733481d64398e3930
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,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-anonymize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.0.0
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-08-18 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-08-24 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'
13
27
  description: anonymize strings
14
28
  email: dorian@dorianmarie.com
15
29
  executables: