EXtremeZip 2022.1.27 → 2022.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/extremezip.zzaqsv.rb +48 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28ef36288016b807b01a2a9a8b4e5b8c53c28c89ed0686a53b2a5d03c4f3b5b6
4
- data.tar.gz: 45078a0ebfeae22cd0c3d1e1d211702a88f111491842bbc92de3410a925d38ce
3
+ metadata.gz: 18b15f99993a00ab85f9dc642d40bd43141eb4f59c357c14f11155476eeee56d
4
+ data.tar.gz: 602d58ef6b385072c725263f96fc0dcdaa045c98c106d1c006f88b1bf285504a
5
5
  SHA512:
6
- metadata.gz: b7d21377242380c6610b40d7ddca1d3bc7a3a3b1140e879317059a4e2993a8a8a0db38a3e6b632c1ac6e337fa55064cedde5b98f04445a8687bb50d8c50cf977
7
- data.tar.gz: de35bd17671ba87ae37c97ab053d1bbf578622f4fa380899218e8a71c74108f8d55961c2227180f5e3126c9075b5dc3b722504d2cfba24192a51672d1bfe9414
6
+ metadata.gz: c13853be7482d3e5a0592f5dc866dda963dc186823f087cf506fdd9556ee4ccb1b579f756d6e3ba39b6c595c7dff6b0baec6e9929824881fb2ce452e20440254
7
+ data.tar.gz: 8935108d009d1884da3ba99e4fc20cefbd335c1cd8de818a1b93958726e5e9320f6e1762aec72442026f63149fdf90de3e603fb9d4d55b93ed51cfe3bc584a68
@@ -48,10 +48,14 @@ class ExtremeZip
48
48
 
49
49
  # 加入基本文件信息
50
50
  def addBasicFileInformation
51
- @wholeCbor['version'] = 233 # 文件格式版本号
51
+ @wholeCbor['version'] = 251 # 文件格式版本号
52
52
 
53
53
  uuid = UUID.new # 获取生成器
54
54
  @wholeCbor['uuid'] = uuid.generate # 指定本个压缩包的唯一编号
55
+
56
+ @wholeCbor['website']='https://rubygems.org/gems/EXtremeZip' # 加入网站地址
57
+
58
+ @wholeCbor['vfsDataListStart']=198910 # 压缩 VFS 数据列表起始位置。
55
59
  end # addBasicFileInformation # 加入基本文件信息
56
60
 
57
61
  # 压缩
@@ -72,10 +76,46 @@ class ExtremeZip
72
76
  @wholeCbor['vfsDataList'] = @vfsDataList # 加入数据
73
77
 
74
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
75
87
 
76
88
  # 写入文件:
77
89
  writeFile(wholeFileContent, victoriaFresh) # 写入文件内容
90
+
91
+ appendVfsDataList # 追加压缩块列表数据。
78
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
79
119
 
80
120
  # 写入文件内容
81
121
  def writeFile(wholeFileContent, victoriaFresh)
@@ -92,8 +132,14 @@ class ExtremeZip
92
132
  currentSubProcess=processIdList[processCounter] # 获取子进程对象
93
133
  #processIdList.each do |currentSubProcess|
94
134
  compressed = receiveFromSubProcess(currentSubProcess, responsePipeList, processCounter) # 从子进程中读取数据,并终止子进程
135
+
136
+ #写入当前压缩块到文件系统中去作为缓存。陈欣
137
+ writeCompressBlock(compressed, processCounter) # 写入压缩块文件
138
+
139
+ blockInfo={} # 块信息
140
+ blockInfo['length']=compressed.length # 记录长度
95
141
 
96
- @vfsDataList << compressed # 加入数据块列表中
142
+ @vfsDataList << blockInfo # 加入数据块列表中
97
143
  checkMemoryUsage(150)
98
144
 
99
145
  processCounter += 1 # 子进程计数
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.1.27
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-01-27 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cod