slyce 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/slyce +6 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91edeaa8cb6e4b9558e048a8e7ad12930d5bfef263a81f910097f22ff8bd4d80
4
- data.tar.gz: 4f88700e316728eec0302629b681960c7d83a0bb822bc7633266fda61046ef78
3
+ metadata.gz: 86b46697d15f638424f3369939a12f962a5daa1a9614bb1cf98cb34c8b8d2519
4
+ data.tar.gz: 9361896529ecaf43baef50da66e2cf41600cc42a110b3af5b97bc53e81270ef5
5
5
  SHA512:
6
- metadata.gz: 918dc893d4ed97407780cce69a732ae4d447d95ce2e5d0a7c7f3716da23926fade500c1d6b5572d5badaec2d18e43651ea55b99e1cd319f20e564b144045f056
7
- data.tar.gz: 23e29b06c3c0f59cb8dc19eeff412cbf77590014d81aca62ef7aca18d961a1c0184b1e9efbcbe0376d9e54a3b82810046df7e818c3a6c64679787b90b87653f2
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.0"
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 #{show})" % [wide, seen] if show
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slyce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve