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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a18211ccbc5a5f68438269308ad9be2aad5c5700a43af1a26226fa7ad4caba95
4
- data.tar.gz: 29bd1c6254a7f6ca4d6f3ec0542b245165f7c0c02663a9bfeb3addfde5151d7d
3
+ metadata.gz: 18b15f99993a00ab85f9dc642d40bd43141eb4f59c357c14f11155476eeee56d
4
+ data.tar.gz: 602d58ef6b385072c725263f96fc0dcdaa045c98c106d1c006f88b1bf285504a
5
5
  SHA512:
6
- metadata.gz: c90dc130aef9445e25a4c08c2db1a9b3c1f58b6219f4c33f8da587fa7d4ecb18f2cc3be41cd728081fc6fcf02779685c729a59c9703f3b621326112878dfdc7e
7
- data.tar.gz: 8e92ce441802aa5d21fe4fa6cb7c69336b545cf5e4f42c44e878bfe976db8edad462fbb781881213a46b3c2d20630127c3f009baa7b48446d4b5fb97a3206da9
6
+ metadata.gz: c13853be7482d3e5a0592f5dc866dda963dc186823f087cf506fdd9556ee4ccb1b579f756d6e3ba39b6c595c7dff6b0baec6e9929824881fb2ce452e20440254
7
+ data.tar.gz: 8935108d009d1884da3ba99e4fc20cefbd335c1cd8de818a1b93958726e5e9320f6e1762aec72442026f63149fdf90de3e603fb9d4d55b93ed51cfe3bc584a68
@@ -145,7 +145,7 @@ class ExtremeUnZip
145
145
 
146
146
  fileToRemove = File.new(victoriaFreshDataFile) # 要删除的文件
147
147
 
148
- File.delete(fileToRemove) # 删除文件
148
+ #File.delete(fileToRemove) # 删除文件
149
149
 
150
150
  end # if (fileVersion<14) #版本号过小
151
151
 
@@ -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'] = 233 # 文件格式版本号
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 << compressed # 加入数据块列表中
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.1.9
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-08 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
@@ -86,20 +86,20 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 2022.1.10
89
+ version: 2022.1.27
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 2022.1.10
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.10
99
+ version: 2022.1.27
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 2022.1.10
102
+ version: 2022.1.27
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: hx_cbor
105
105
  requirement: !ruby/object:Gem::Requirement