slyce 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/slyce +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86b46697d15f638424f3369939a12f962a5daa1a9614bb1cf98cb34c8b8d2519
|
4
|
+
data.tar.gz: 9361896529ecaf43baef50da66e2cf41600cc42a110b3af5b97bc53e81270ef5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4bd3c648d559ee5f0d7395c09e0836f3d309a1a99729f9d5fdd0d1441ccd8954dc0275e13b0de35d471a51f3c7b64bcfefa6cf0120c53a3ad2b9eef92e09d76
|
7
|
+
data.tar.gz: f2100f83caa2d1b116b0cc934841ce450208dc38dcf370242a788b563feb6ac84a4499e24a691e210425eca4c7102daaa1f4a45833e05617120b9de7b9d41cdf
|
data/bin/slyce
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
|
3
3
|
STDOUT.sync = true
|
4
4
|
|
5
|
-
VERSION="0.5.
|
5
|
+
VERSION="0.5.2"
|
6
6
|
|
7
7
|
require "bundler/setup"
|
8
8
|
require "mysql2"
|
9
9
|
require "optparse"
|
10
10
|
|
11
|
+
trap("INT" ) { abort "\n" }
|
12
|
+
|
11
13
|
dbas = nil
|
12
14
|
tabl = nil
|
13
15
|
|
@@ -40,6 +42,7 @@ end
|
|
40
42
|
|
41
43
|
def display(name, data, show, uniq, tots)
|
42
44
|
seen = data.inject(0) {|seen, coun| seen += coun[0] }
|
45
|
+
rows = [data.size, seen].min
|
43
46
|
wide = tots.to_s.size
|
44
47
|
fill = " " * wide
|
45
48
|
line = "=" * name.size
|
@@ -47,7 +50,7 @@ def display(name, data, show, uniq, tots)
|
|
47
50
|
puts "\n#{fill} #{name}\n#{fill} #{line}\n"
|
48
51
|
data.each {|cnt, val| puts "%*d %s" % [wide, cnt, val || "NULL"] }
|
49
52
|
puts "#{fill} -----\n"
|
50
|
-
puts "%*d shown (top #{
|
53
|
+
puts "%*d shown (top #{rows})" % [wide, rows] if show
|
51
54
|
puts "%*d total (all #{uniq})" % [wide, tots]
|
52
55
|
end
|
53
56
|
|
@@ -80,7 +83,7 @@ keep.each do |name|
|
|
80
83
|
|
81
84
|
uniq = conn.query(<<~"").to_a[0][0]
|
82
85
|
select
|
83
|
-
count(distinct(`#{name}
|
86
|
+
count(distinct(ifnull(`#{name}`,0)))
|
84
87
|
from
|
85
88
|
`#{tabl}`
|
86
89
|
|