EventChart 2022.6.8 → 2022.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/eventchart +4 -2
- data/lib/eventchart.js.rb +60 -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: 2de760ff473ce903568b5b98401c7aae4c7e69c23ed582d9831813ed0fbe00a9
|
4
|
+
data.tar.gz: 33e31ca108f6a478d9a1afb56bf62ab081083a39327772a6b72a45d894100952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca1dfff55bcb0cab576c02a91e587b789fdaea6685a88e896cca6285a7612f5102b26b8b1136eb19281d451e575dcfdf4f9f926a065b0e546d03539ad3779e4
|
7
|
+
data.tar.gz: a9eef3db6fe0fbaa79ad1cae99251774e342c31b5aa8214265a630a15b2f6c5acb5a09f3be47bd0ee4ce36a813cca72ad1770f8aee312155eaef5dc87a15f0c0
|
data/bin/eventchart
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eventchart.js'
|
4
4
|
|
5
5
|
if ARGV.empty? # 未指定命令行参数。
|
6
6
|
else # 指定了命令行参数。
|
7
7
|
returnCode = 0 # 失败
|
8
8
|
$rootPath = ARGV[0] # 记录要打包的目录树的根目录。
|
9
9
|
|
10
|
-
exuzObject =
|
10
|
+
exuzObject = EventChart.new # 解压对象
|
11
11
|
|
12
12
|
result = exuzObject.exuz($rootPath) # 解压
|
13
|
+
|
14
|
+
puts result
|
13
15
|
|
14
16
|
if result # 解压成功
|
15
17
|
else # 解压失败
|
data/lib/eventchart.js.rb
CHANGED
@@ -33,4 +33,64 @@ class EventChart
|
|
33
33
|
extremeZipOutputFile.syswrite(compressed) # 写入文件
|
34
34
|
extremeZipOutputFile.close # 关闭文件
|
35
35
|
end
|
36
|
+
|
37
|
+
# 解压
|
38
|
+
def exuz(rootPath)
|
39
|
+
result = true # 解压结果
|
40
|
+
|
41
|
+
currentBlockFile = File.new(rootPath, 'rb') # 打开文件
|
42
|
+
|
43
|
+
@wholeFileContent = currentBlockFile.read # 读取全部内容
|
44
|
+
|
45
|
+
currentBlockFile.close # 关闭文件
|
46
|
+
|
47
|
+
wholeCborByteArray = @wholeFileContent # 从第5个到末尾
|
48
|
+
|
49
|
+
begin # 可能出错。
|
50
|
+
options = {:tolerant => true}
|
51
|
+
|
52
|
+
wholeCbor = CBOR.decode(wholeCborByteArray, options) # 解码
|
53
|
+
|
54
|
+
#puts wholeCbor
|
55
|
+
|
56
|
+
x=1..wholeCbor.length
|
57
|
+
y=wholeCbor.map { |event| event["optimisticScore"] }
|
58
|
+
y1=wholeCbor.map { |event| event["speciesScore"] }
|
59
|
+
|
60
|
+
#puts x
|
61
|
+
#puts y
|
62
|
+
|
63
|
+
xString=""
|
64
|
+
|
65
|
+
x.each { |value| xString=xString+"#{value}," }
|
66
|
+
|
67
|
+
xString="[#{xString}]"
|
68
|
+
|
69
|
+
#puts xString
|
70
|
+
|
71
|
+
yString=""
|
72
|
+
y.each { |value| yString=yString+"#{value}," }
|
73
|
+
|
74
|
+
yString="[#{yString}]"
|
75
|
+
|
76
|
+
#puts yString
|
77
|
+
|
78
|
+
yString1=""
|
79
|
+
y1.each { |value| yString1=yString1+"#{value}," }
|
80
|
+
|
81
|
+
yString1="[#{yString1}]"
|
82
|
+
|
83
|
+
#puts yString1
|
84
|
+
|
85
|
+
|
86
|
+
result =true # 解压成功
|
87
|
+
rescue EOFError => e # 文件内容提前到末尾。一般是压缩包文件未传输完全 。
|
88
|
+
#puts "Error: the exz file may be incomplete." # 报告错误。文件可能不完整。
|
89
|
+
|
90
|
+
result = false # 失败
|
91
|
+
end #begin # 可能出错。
|
92
|
+
|
93
|
+
wholeCbor
|
94
|
+
end # def exuz(rootPath)
|
95
|
+
|
36
96
|
end # class ExtremeUnZip
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: EventChart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2022.6.
|
4
|
+
version: 2022.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hxcan Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cod
|