EXtremeZip 2022.1.9 → 2022.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extremeunzip.zzaqsu.rb +1 -1
- data/lib/extremezip.zzaqsv.rb +50 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18b15f99993a00ab85f9dc642d40bd43141eb4f59c357c14f11155476eeee56d
|
4
|
+
data.tar.gz: 602d58ef6b385072c725263f96fc0dcdaa045c98c106d1c006f88b1bf285504a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c13853be7482d3e5a0592f5dc866dda963dc186823f087cf506fdd9556ee4ccb1b579f756d6e3ba39b6c595c7dff6b0baec6e9929824881fb2ce452e20440254
|
7
|
+
data.tar.gz: 8935108d009d1884da3ba99e4fc20cefbd335c1cd8de818a1b93958726e5e9320f6e1762aec72442026f63149fdf90de3e603fb9d4d55b93ed51cfe3bc584a68
|
data/lib/extremeunzip.zzaqsu.rb
CHANGED
data/lib/extremezip.zzaqsv.rb
CHANGED
@@ -33,6 +33,7 @@ class ExtremeZip
|
|
33
33
|
@clipDownloader.diskMultiFile = true # 写多个磁盘文件
|
34
34
|
@clipDownloader.diskFileName = 'victoriafreshdata.v.' # 磁盘文件名前缀
|
35
35
|
@clipDownloader.diskFlushSize = @dataBlockLength # 磁盘文件大小
|
36
|
+
@clipDownloader.ignoreFileName= '.exzignore' # 设置用于指定忽略文件列表的文件名。
|
36
37
|
end # def initialize
|
37
38
|
|
38
39
|
# 压缩目录数据。
|
@@ -47,10 +48,14 @@ class ExtremeZip
|
|
47
48
|
|
48
49
|
# 加入基本文件信息
|
49
50
|
def addBasicFileInformation
|
50
|
-
@wholeCbor['version'] =
|
51
|
+
@wholeCbor['version'] = 251 # 文件格式版本号
|
51
52
|
|
52
53
|
uuid = UUID.new # 获取生成器
|
53
54
|
@wholeCbor['uuid'] = uuid.generate # 指定本个压缩包的唯一编号
|
55
|
+
|
56
|
+
@wholeCbor['website']='https://rubygems.org/gems/EXtremeZip' # 加入网站地址
|
57
|
+
|
58
|
+
@wholeCbor['vfsDataListStart']=198910 # 压缩 VFS 数据列表起始位置。
|
54
59
|
end # addBasicFileInformation # 加入基本文件信息
|
55
60
|
|
56
61
|
# 压缩
|
@@ -71,10 +76,46 @@ class ExtremeZip
|
|
71
76
|
@wholeCbor['vfsDataList'] = @vfsDataList # 加入数据
|
72
77
|
|
73
78
|
wholeFileContent = 'exz' + "\0" + @wholeCbor.to_cbor # 追加CBOR字节数组
|
79
|
+
|
80
|
+
vfsDataListStart=wholeFileContent.length # 按照现在的序列化情况,计算出来的起始位置。
|
81
|
+
|
82
|
+
while (vfsDataListStart!=@wholeCbor['vfsDataListStart']) # 计算出的偏移不一致
|
83
|
+
@wholeCbor['vfsDataListStart']=vfsDataListStart # 使用新的值
|
84
|
+
wholeFileContent = 'exz' + "\0" + @wholeCbor.to_cbor # 追加CBOR字节数组
|
85
|
+
vfsDataListStart=wholeFileContent.length # 按照现在的序列化情况,计算出来的起始位置。
|
86
|
+
end
|
74
87
|
|
75
88
|
# 写入文件:
|
76
89
|
writeFile(wholeFileContent, victoriaFresh) # 写入文件内容
|
90
|
+
|
91
|
+
appendVfsDataList # 追加压缩块列表数据。
|
77
92
|
end # def exz(rootPath)
|
93
|
+
|
94
|
+
# 写入压缩块文件
|
95
|
+
def writeCompressBlock(compressed, processCounter)
|
96
|
+
extremeZipOutputFile = File.new("comressed.#{processCounter}.cex", 'wb') # 创建文件
|
97
|
+
extremeZipOutputFile.syswrite(compressed) # 写入文件
|
98
|
+
extremeZipOutputFile.close # 关闭文件
|
99
|
+
end
|
100
|
+
|
101
|
+
# 追加压缩块列表数据。
|
102
|
+
def appendVfsDataList
|
103
|
+
extremeZipOutputFile = File.new("#{victoriaFresh['name']}.exz", 'ab') # 打开文件
|
104
|
+
|
105
|
+
processCounter=0 # 块计数器。
|
106
|
+
|
107
|
+
@wholeCbor['vfsDataList'].each do
|
108
|
+
#extremeZipOutputFile = File.new("comressed.#{processCounter}.cex", 'wb') # 创建文件
|
109
|
+
|
110
|
+
wholeFileContent=File.read("comressed.#{processCounter}.cex") # 读取压缩块。
|
111
|
+
|
112
|
+
extremeZipOutputFile.syswrite(wholeFileContent) # 写入文件
|
113
|
+
|
114
|
+
processCounter += 1 # 计数
|
115
|
+
end
|
116
|
+
|
117
|
+
extremeZipOutputFile.close # 关闭文件
|
118
|
+
end
|
78
119
|
|
79
120
|
# 写入文件内容
|
80
121
|
def writeFile(wholeFileContent, victoriaFresh)
|
@@ -91,8 +132,14 @@ class ExtremeZip
|
|
91
132
|
currentSubProcess=processIdList[processCounter] # 获取子进程对象
|
92
133
|
#processIdList.each do |currentSubProcess|
|
93
134
|
compressed = receiveFromSubProcess(currentSubProcess, responsePipeList, processCounter) # 从子进程中读取数据,并终止子进程
|
135
|
+
|
136
|
+
#写入当前压缩块到文件系统中去作为缓存。陈欣
|
137
|
+
writeCompressBlock(compressed, processCounter) # 写入压缩块文件
|
138
|
+
|
139
|
+
blockInfo={} # 块信息
|
140
|
+
blockInfo['length']=compressed.length # 记录长度
|
94
141
|
|
95
|
-
@vfsDataList <<
|
142
|
+
@vfsDataList << blockInfo # 加入数据块列表中
|
96
143
|
checkMemoryUsage(150)
|
97
144
|
|
98
145
|
processCounter += 1 # 子进程计数
|
@@ -111,7 +158,7 @@ class ExtremeZip
|
|
111
158
|
|
112
159
|
currentBlockFile.close # 关闭文件
|
113
160
|
|
114
|
-
File.delete(currentBlockFile) # 删除数据块文件
|
161
|
+
#File.delete(currentBlockFile) # 删除数据块文件
|
115
162
|
|
116
163
|
currentBlockData
|
117
164
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: EXtremeZip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2022.
|
4
|
+
version: 2022.2.4
|
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-
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cod
|
@@ -86,20 +86,20 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2022.1.
|
89
|
+
version: 2022.1.27
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 2022.1.
|
92
|
+
version: 2022.1.27
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 2022.1.
|
99
|
+
version: 2022.1.27
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 2022.1.
|
102
|
+
version: 2022.1.27
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: hx_cbor
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|