ix-cli 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ix-json-to-html-table-2 +52 -0
- data/bin/ix-log +2 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a93c4bdefb86d113639d482e2990c79d2ef522679af345af47b1ff6ed366ca
|
4
|
+
data.tar.gz: 2dc28f1d95c328fe921daf120ec952b9f32f91033a393c5a8b05945e7bcd5ce9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e65bd566ec921c9b34d957de086b31a8b502bb4c5a4c65d81314e1288217ae5925456a65d494c1e8e5109b1e27d9cc9af14f973950d0a11d785d6f765644b267
|
7
|
+
data.tar.gz: 1431995302b4aa3106b0a703991d7318d2bc00737662b34a0241df9758393a7b6064426012b012b4e543709d8b501c75554d7d10cf759e09c709c8a18547ac95
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
def tag(name, content)
|
7
|
+
"<#{name}>#{content}</#{name}>"
|
8
|
+
end
|
9
|
+
|
10
|
+
def row(name, array)
|
11
|
+
array.map do |value|
|
12
|
+
tag(name, value)
|
13
|
+
end * ' '
|
14
|
+
end
|
15
|
+
|
16
|
+
table_header = false
|
17
|
+
|
18
|
+
puts '
|
19
|
+
<style>
|
20
|
+
tr:nth-child(even) {
|
21
|
+
background-color: whitesmoke;
|
22
|
+
}
|
23
|
+
th {
|
24
|
+
background: darkgray;
|
25
|
+
font-color: white;
|
26
|
+
padding: 1mm;
|
27
|
+
}
|
28
|
+
td {
|
29
|
+
padding: 1mm;
|
30
|
+
}
|
31
|
+
</style>
|
32
|
+
'
|
33
|
+
|
34
|
+
STDIN.each_line do |line|
|
35
|
+
begin
|
36
|
+
object = JSON.parse(line)
|
37
|
+
unless table_header
|
38
|
+
puts '<table>'
|
39
|
+
table_header_row = row('th', object.keys.sort)
|
40
|
+
puts tag('tr', table_header_row)
|
41
|
+
table_header = true
|
42
|
+
end
|
43
|
+
copy = object.keys.sort.map do |key|
|
44
|
+
object[key]
|
45
|
+
end
|
46
|
+
table_body_row = row('td', copy)
|
47
|
+
puts tag('tr', table_body_row)
|
48
|
+
rescue => error
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
puts '</table>'
|
data/bin/ix-log
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ix-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuyoshi Tlacaelel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-02-05 00:00:00.000000000 Z
|
@@ -24,8 +24,8 @@ dependencies:
|
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.4
|
27
|
-
description:
|
28
|
-
email:
|
27
|
+
description:
|
28
|
+
email:
|
29
29
|
executables:
|
30
30
|
- ix
|
31
31
|
- ix-acronym
|
@@ -151,6 +151,7 @@ executables:
|
|
151
151
|
- ix-json-to-csv
|
152
152
|
- ix-json-to-dot
|
153
153
|
- ix-json-to-html-table
|
154
|
+
- ix-json-to-html-table-2
|
154
155
|
- ix-json-to-ruby-hash
|
155
156
|
- ix-json-to-table
|
156
157
|
- ix-json-to-table-2
|
@@ -431,6 +432,7 @@ files:
|
|
431
432
|
- bin/ix-json-to-csv
|
432
433
|
- bin/ix-json-to-dot
|
433
434
|
- bin/ix-json-to-html-table
|
435
|
+
- bin/ix-json-to-html-table-2
|
434
436
|
- bin/ix-json-to-ruby-hash
|
435
437
|
- bin/ix-json-to-table
|
436
438
|
- bin/ix-json-to-table-2
|
@@ -582,10 +584,10 @@ files:
|
|
582
584
|
- bin/ix-wrap
|
583
585
|
- bin/ix-xy
|
584
586
|
- bin/ix-zebra
|
585
|
-
homepage:
|
587
|
+
homepage:
|
586
588
|
licenses: []
|
587
589
|
metadata: {}
|
588
|
-
post_install_message:
|
590
|
+
post_install_message:
|
589
591
|
rdoc_options: []
|
590
592
|
require_paths:
|
591
593
|
- lib
|
@@ -600,8 +602,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
600
602
|
- !ruby/object:Gem::Version
|
601
603
|
version: '0'
|
602
604
|
requirements: []
|
603
|
-
rubygems_version: 3.
|
604
|
-
signing_key:
|
605
|
+
rubygems_version: 3.0.3
|
606
|
+
signing_key:
|
605
607
|
specification_version: 4
|
606
608
|
summary: ix - string manipulation tools
|
607
609
|
test_files: []
|