slyce 0.9.9 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/slyce +4 -6
  3. data/bin/slyce3 +5 -7
  4. data/slyce.gemspec +1 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e12e5c9ffea5f786419c30b2cca3fc8a7dacf2f3a389e28f30b23595a813574
4
- data.tar.gz: 8f25aeac74b908508787b68ad352948e6aed14cbd35d3efa67e9a34aed4fb350
3
+ metadata.gz: e5dcf804e2deb0adaff36f965561a0946e20ba4b0740d3a83ea064f09409f73a
4
+ data.tar.gz: 8975517f3e9ac589fac7117b37c652af7b8ec463e3abbc002cc7a2e0523494c9
5
5
  SHA512:
6
- metadata.gz: 7182a32b9b2734f8813e6741ea562333f78809607c708b4bd08e08ed16df29a737f1966cbbec0e26b50ae12c818a0bfef5651757d0b08ec3d2890e90d10c1149
7
- data.tar.gz: 7563b2004ca166a364de70fa42a20739c4f9f1e26f39ccc22cf0cf7d2ae81111c67adbec2c59f1afeb379549ee50689f2f21527ce5327b0e2dd32b6fa743fcbb
6
+ metadata.gz: 59a99719c5a7c7193753bdf34075d67db43906da64e984e629104be5d9d4906b42bb7c6bc21d62f835af56c053480c861699a589398759d4b6d0ff621a406171
7
+ data.tar.gz: 89bf5f7e16919e60e836c56da62460b1ff0760e7397fe579fdc61144d1492f3b0adb15423ae000c8a0a959a0fd0012ed8fd64fd9b0f4e82301d319b25bacaa8f
data/bin/slyce CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- VERSION="0.9.9"
3
+ VERSION="1.0.1"
4
4
 
5
5
  STDOUT.sync = true
6
6
 
@@ -17,7 +17,7 @@ OptionParser.new.instance_eval do
17
17
 
18
18
  on "-c", "--columns" , "Display column names and quit"
19
19
  on "-h", "--help" , "Show help and command usage" do Kernel.abort to_s; end
20
- on "-n", "--natural" , "Sort naturally, not numerically",
20
+ on "-n", "--natural" , "Sort naturally, not numerically"
21
21
  on "-s", "--show <count>" , "Show this many values", Integer
22
22
  on "-v", "--version" , "Show version number" do Kernel.abort "#{program_name} #{VERSION}"; end
23
23
  on "-w", "--where <cond>" , "Where clause (eg - 'age>50 and state='AZ')"
@@ -37,9 +37,7 @@ tabl ||= ARGV.shift or abort "no table given"
37
37
  # ==[ Helpers ]==
38
38
 
39
39
  class Mysql2::Client
40
- def sql(...)
41
- query(...)
42
- end
40
+ alias_method :sql, :query
43
41
 
44
42
  def sql!(stmt, *args, **, &)
45
43
  puts "\n==[ SQL statement ]==\n\n", stmt.strip, ";"
@@ -57,7 +55,7 @@ def display(name, data, show, uniq, tots)
57
55
  puts "\n#{fill} #{name}\n#{fill} #{line}\n"
58
56
  data.each {|cnt, val| puts "%*d %s" % [wide, cnt, val || "NULL"] }
59
57
  puts "#{fill} -----\n"
60
- puts "%*d shown (top %d)" % [wide, seen, rows] if show
58
+ puts "%*d shown (top %d)" % [wide, seen, rows] if show && rows > 1
61
59
  puts "%*d total (all %d)" % [wide, tots, uniq]
62
60
  end
63
61
 
data/bin/slyce3 CHANGED
@@ -9,7 +9,7 @@
9
9
  # wget https://github.com/nalgeon/sqlean/releases/download/0.19.3/sqlean-macos-arm64.zip
10
10
  # unzip sqlean-macos-arm64.zip regexp.dylib
11
11
 
12
- VERSION="0.9.9"
12
+ VERSION="1.0.1"
13
13
 
14
14
  STDOUT.sync = true
15
15
 
@@ -26,7 +26,7 @@ OptionParser.new.instance_eval do
26
26
 
27
27
  on "-c", "--columns" , "Display column names and quit"
28
28
  on "-h", "--help" , "Show help and command usage" do Kernel.abort to_s; end
29
- on "-n", "--natural" , "Sort naturally, not numerically",
29
+ on "-n", "--natural" , "Sort naturally, not numerically"
30
30
  on "-r", "--regexp <path>" , "Path to the sqlean/regexp extension"
31
31
  on "-s", "--show <count>" , "Show this many values", Integer
32
32
  on "-v", "--version" , "Show version number" do Kernel.abort "#{program_name} #{VERSION}"; end
@@ -38,7 +38,7 @@ end.parse!(into: opts={}) rescue abort($!.message)
38
38
 
39
39
  filt = opts[:where] and filt = "where\n #{filt}"
40
40
  natu = opts[:natural]
41
- regx = opts[:regexp] || Dir["{,sqlean}/regexp.{dll,dylib,so}"].first
41
+ regx = opts[:regexp] || Dir["{.,sqlean}/regexp.{dll,dylib,so}"].first
42
42
  show = opts[:show]
43
43
  want = opts[:extract].to_s.downcase.split(",")
44
44
 
@@ -50,9 +50,7 @@ regx && File.exist?(regx) or abort "no regexp extension found#{regx ? " at '#{r
50
50
  # ==[ Helpers ]==
51
51
 
52
52
  class Extralite::Database
53
- def sql(...)
54
- query_ary(...)
55
- end
53
+ alias_method :sql, :query_ary
56
54
 
57
55
  def sql!(stmt, *args, **, &)
58
56
  puts "\n==[ SQL statement ]==\n\n", stmt.strip, ";"
@@ -70,7 +68,7 @@ def display(name, data, show, uniq, tots)
70
68
  puts "\n#{fill} #{name}\n#{fill} #{line}\n"
71
69
  data.each {|cnt, val| puts "%*d %s" % [wide, cnt, val || "NULL"] }
72
70
  puts "#{fill} -----\n"
73
- puts "%*d shown (top %d)" % [wide, seen, rows] if show
71
+ puts "%*d shown (top %d)" % [wide, seen, rows] if show and rows > 1
74
72
  puts "%*d total (all %d)" % [wide, tots, uniq]
75
73
  end
76
74
 
data/slyce.gemspec CHANGED
@@ -11,6 +11,6 @@ Gem::Specification.new do |s|
11
11
  s.license = "MIT"
12
12
  s.files = `git ls-files`.split("\n") - %w[.gitignore]
13
13
  s.executables = `cd bin && git ls-files .`.split("\n")
14
- s.add_runtime_dependency "extralite-bundle", "~> 1.2.5"
14
+ s.add_runtime_dependency "extralite-bundle", "~> 1.25"
15
15
  s.add_runtime_dependency "mysql2", "~> 0.5"
16
16
  end
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.9.9
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.5
19
+ version: '1.25'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.5
26
+ version: '1.25'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mysql2
29
29
  requirement: !ruby/object:Gem::Requirement