dorian-anonymize-yaml 0.2.0 → 0.2.3
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 -14
- metadata +19 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b4a24d6484fb6c4079c7777f0f1bfdb54c4d0f16bd53ebb771388fd009d6cc3
|
4
|
+
data.tar.gz: 93debeed80b244757704efc1e610a2e0db4a3e58cc74bc3a4a6b2e3c32279006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0543dc286a648769f4fe64fbdbc71a5f56d2e6fb13d8f596b58e89e6118ab811e4d0c1b6dc050ae7a4d83f51583626ede4736983c0a80539df4d57df2ce4ed79
|
7
|
+
data.tar.gz: cb86e85bbd65cc9f20374ad95af72a6d2936b7545583b845540835c39275ec823fab52fdbe55effacd35a7f75e2c614f64d267373b467297a375ff3f266af8f4
|
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,17 @@ 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
|
|
34
|
+
inputs = parsed.arguments + parsed.files.map { |file| File.read(file) }
|
35
|
+
inputs = [$stdin.each_line.to_a.join] if inputs.empty?
|
36
|
+
|
40
37
|
inputs.each do |input|
|
41
|
-
|
42
|
-
yaml = anonymize_yaml(YAML.safe_load(content)).to_yaml
|
43
|
-
File.exist?(input) ? File.write(input, yaml) : puts(yaml)
|
38
|
+
puts anonymize_yaml(YAML.safe_load(input)).to_yaml
|
44
39
|
end
|
metadata
CHANGED
@@ -1,19 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-anonymize-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
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-
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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 yaml file
|
17
28
|
email: dorian@dorianmarie.com
|
18
29
|
executables:
|
19
30
|
- anonymize-yaml
|
@@ -44,5 +55,5 @@ requirements: []
|
|
44
55
|
rubygems_version: 3.5.11
|
45
56
|
signing_key:
|
46
57
|
specification_version: 4
|
47
|
-
summary:
|
58
|
+
summary: anonymize yaml file
|
48
59
|
test_files: []
|