baze 1.0 → 1.1.1
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 +4 -4
- data/bin/jsonflat +44 -0
- metadata +17 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cbf73fde50470dd9adc667314de6a641c5422ae
|
4
|
+
data.tar.gz: 8454583eeff8270774bca055e770d90bb2b1753b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37b3c338bb05f806c5e45004e6392388b2845d432f1e301b3226dc7b466e023bfcc141a7bb77ae41bbd28c405eab3198793446b110e181d1294e76fa26a7b70c
|
7
|
+
data.tar.gz: 6cc6b194fa4cbe588968dd07e48d62173b635c01e9b4e58fca802523fb99a25dbe9dc4f5f202dc1ebfb8caa391cb3924865024ef8c51f11e7dd7e9cb2328443b
|
data/bin/jsonflat
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
def escaped name
|
5
|
+
if name =~ /\.=/
|
6
|
+
name.inspect
|
7
|
+
else
|
8
|
+
name
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def subpath parent, name
|
13
|
+
if parent
|
14
|
+
"#{parent}.#{escaped name}"
|
15
|
+
else
|
16
|
+
escaped name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def format node
|
21
|
+
case node
|
22
|
+
when nil
|
23
|
+
'null'
|
24
|
+
else
|
25
|
+
node.inspect
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def traverse node, path
|
30
|
+
case node
|
31
|
+
when Hash
|
32
|
+
node.each_pair do |k, v|
|
33
|
+
traverse v, subpath(path, k)
|
34
|
+
end
|
35
|
+
when Enumerable
|
36
|
+
node.each_with_index do |v, i|
|
37
|
+
traverse v, subpath(path, i)
|
38
|
+
end
|
39
|
+
else
|
40
|
+
puts "#{path}=#{format node}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
traverse JSON::parse(ARGF.read), nil
|
metadata
CHANGED
@@ -1,36 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Carrier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
15
|
-
-
|
15
|
+
- pc@rrier.ca
|
16
16
|
executables:
|
17
|
-
- urlencode
|
18
|
-
- shellescape
|
19
|
-
- suc
|
20
17
|
- primes
|
21
18
|
- cols
|
19
|
+
- json2yaml
|
20
|
+
- urldecode
|
21
|
+
- yaml2json
|
22
|
+
- lecho
|
23
|
+
- jsonflat
|
24
|
+
- randmac
|
22
25
|
- hex2ip
|
23
|
-
- fixperms
|
24
26
|
- shost
|
25
|
-
-
|
26
|
-
- lecho
|
27
|
+
- suc
|
27
28
|
- rrtmux
|
28
|
-
-
|
29
|
+
- urlencode
|
29
30
|
- ip2hex
|
30
|
-
-
|
31
|
-
- yaml2json
|
31
|
+
- shellescape
|
32
32
|
- statistik
|
33
|
-
-
|
33
|
+
- cupa
|
34
|
+
- fixperms
|
34
35
|
extensions: []
|
35
36
|
extra_rdoc_files: []
|
36
37
|
files:
|
@@ -41,6 +42,7 @@ files:
|
|
41
42
|
- bin/hex2ip
|
42
43
|
- bin/ip2hex
|
43
44
|
- bin/json2yaml
|
45
|
+
- bin/jsonflat
|
44
46
|
- bin/lecho
|
45
47
|
- bin/primes
|
46
48
|
- bin/randmac
|
@@ -71,8 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
73
|
- !ruby/object:Gem::Version
|
72
74
|
version: 1.2.0
|
73
75
|
requirements: []
|
74
|
-
rubyforge_project:
|
75
|
-
rubygems_version: 2.
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.5.2.3
|
76
78
|
signing_key:
|
77
79
|
specification_version: 4
|
78
80
|
summary: Base utilities for POSIX system
|