dorian-anonymize-yaml 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/anonymize-yaml +9 -16
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db5df8ba7510e6f188c108dd7481bd90f1024a221628b95db9d305f82cc1590
|
4
|
+
data.tar.gz: be3ef4a1b9e02a2ff67fbca7561310775851bf00c0e9e20ee8c3db80bcd64de6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 479293ea0edfcae42e5a9d87677140c24698f05abc7dc7a231fccfcdac614f316359b750f439ef41925a347d3affb5f50d9073280ea2f0e6ba29915acbc6ac56
|
7
|
+
data.tar.gz: 5a8a2563881c6441881e5a79dd047436f4d8a765719662b82339117cd25276fda89517f922f3991bc9cd5f2fe9474018e6c2f1717f14fa4e5d93cf5415b462ca
|
data/bin/anonymize-yaml
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "yaml"
|
5
|
+
require "dorian/arguments"
|
5
6
|
|
6
7
|
def anonymize_yaml(data)
|
7
8
|
case data
|
@@ -22,23 +23,15 @@ def anonymize_yaml(data)
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
|
26
|
-
puts "USAGE: anonymize-yaml FILES..."
|
27
|
-
puts "USAGE: ... | anonymize-yaml"
|
28
|
-
exit
|
29
|
-
end
|
30
|
-
|
31
|
-
inputs = ARGV
|
26
|
+
parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
|
32
27
|
|
33
|
-
if
|
34
|
-
inputs = $stdin.each_line.to_a
|
28
|
+
abort parsed.help if parsed.options.help
|
35
29
|
|
36
|
-
|
37
|
-
|
30
|
+
if parsed.options.version
|
31
|
+
abort File.read(File.expand_path("../../VERSION", __FILE__))
|
38
32
|
end
|
39
33
|
|
40
|
-
inputs.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
34
|
+
inputs = parsed.arguments + parsed.files.map { |file| File.read(file) }
|
35
|
+
inputs = [$stdin.each_line.to_a.join] if inputs.empty?
|
36
|
+
|
37
|
+
inputs.each { |input| puts anonymize_yaml(YAML.safe_load(input)).to_yaml }
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-anonymize-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
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-
|
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 yaml file
|
14
28
|
email: dorian@dorianmarie.com
|
15
29
|
executables:
|