kaba 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/kaba +0 -6
- data/lib/kaba/_DPodfile_ +2 -0
- data/lib/kaba/validate.rb +3 -3
- data/lib/kaba/version.rb +1 -1
- data/lib/kaba.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0819a2ca5b94fd6ce32a48fc973dd86d0c2234a073bf32ee9327e02f572b45b2'
|
4
|
+
data.tar.gz: 203c7c8cfcc4d1d059c01b01467f8b897580c4422d25db85335a2b119e674401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8abc31a51664418d2c8df17d2ff370c71b3124df3eb4cd17b9f05d3162e75b7fe76945986e47ae6415d0d43147be83c9627a41e9b9f7181623dcb752e91a0873
|
7
|
+
data.tar.gz: cc4078a6d7b4205d4403a4451ec95d4020c354809332788c755f0d2a2f6381f3d36d5206f96f7b04312a7ddf72348c2fadcf8ee519e63be4bcd730a76761b3bd
|
data/exe/kaba
CHANGED
data/lib/kaba/_DPodfile_
CHANGED
@@ -24,6 +24,8 @@ validate.run_files(source.row)
|
|
24
24
|
dataset.scan()
|
25
25
|
dataset.save(source.join('train.jsonl'))
|
26
26
|
|
27
|
+
puts "Dataset 校验结果:#{dataset.validate}"
|
28
|
+
|
27
29
|
## 高级玩法,不要轻易尝试
|
28
30
|
#
|
29
31
|
### 可以加入 limit 来限制读取的文件数量,validate.run_files('./data/row', limit: 1) do |response, json, file|
|
data/lib/kaba/validate.rb
CHANGED
@@ -18,7 +18,7 @@ class Validate
|
|
18
18
|
# 读取某个文件然后运行
|
19
19
|
def run_file(file)
|
20
20
|
input = JSON.parse File.read(File.expand_path file)
|
21
|
-
ValidateReponse.new run(input)
|
21
|
+
ValidateReponse.new run(input), file: file
|
22
22
|
end
|
23
23
|
|
24
24
|
# 读取某个文件夹下的然后运行,运行有结果了 block 会被调用
|
@@ -75,8 +75,8 @@ class Validate
|
|
75
75
|
|
76
76
|
def to_s
|
77
77
|
s = "#{'success:'.colorize(:bold_blue)} #{success? ? 'true'.colorize(:green) : 'false'.colorize(:red)}"
|
78
|
-
s += "\n#{'file:'.colorize(:bold_blue)} #{file
|
79
|
-
s += "\n#{'message:'.colorize(:bold_blue)} #{message
|
78
|
+
s += "\n#{'file:'.colorize(:bold_blue)} #{file&.to_s&.colorize(:yellow)}"
|
79
|
+
s += "\n#{'message:'.colorize(:bold_blue)} #{message&.colorize(:yellow)}" unless success?
|
80
80
|
s += "\n\n"
|
81
81
|
end
|
82
82
|
end
|
data/lib/kaba/version.rb
CHANGED
data/lib/kaba.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'async'
|
4
|
+
require 'faraday'
|
5
|
+
require 'colorize'
|
6
|
+
require 'tty-progressbar'
|
7
|
+
require 'async/http/faraday'
|
8
|
+
|
3
9
|
require_relative "kaba/version"
|
4
10
|
require_relative "kaba/dataset"
|
5
11
|
require_relative "kaba/dataset_source"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MJ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|