VictoriaFreSh 2022.2.24 → 2024.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/victoriafresh.rb +15 -9
- data/victoriafresh.example.rb +10 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f78771d735509341cc1b402df118d8854f3ada0c909765f2590e893e714934d7
|
4
|
+
data.tar.gz: 5bd24fb40c26a4a8510fa5813dbaa785b01315d1a6a3afc59d37d49ef2e80b5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d9a0d3719a9d9d90f555be54ddc088c60b7202331892a2d94285d410a8e776ff56e916915dfd45e66fabc316f62f2d1e4d40961a16c7565621ee686001c10bc
|
7
|
+
data.tar.gz: 7500dbcffd9aa45b48856bf8d29d703df4f73108a37a15f8120192eddd898dc8f4d12c76aa43dd26c5e7c39d8c41354bda22ceb674f62232695821a43f66694b
|
data/lib/victoriafresh.rb
CHANGED
@@ -20,7 +20,7 @@ class VictoriaFresh
|
|
20
20
|
def initialize
|
21
21
|
@diskFlush=false #要向磁盘写入文件
|
22
22
|
@diskFlushSize=143212 #磁盘分块大小
|
23
|
-
@diskFileName='victoriafreshdata
|
23
|
+
@diskFileName='victoriafreshdata' # Disk file name.
|
24
24
|
@ignoreFileName=nil # 忽略文件名列表配置文件名
|
25
25
|
@diskMultiFile=false #磁盘整个文件,不是多个文件
|
26
26
|
@diskWriteFileObject={} #向磁盘写入文件的对象
|
@@ -146,16 +146,20 @@ class VictoriaFresh
|
|
146
146
|
@externalDataFile.seek(packagedFile['file_start_index']) #定位到起始位置
|
147
147
|
|
148
148
|
victoriaFreshData=@externalDataFile.read(packagedFile['file_length']) #读取内容
|
149
|
-
|
149
|
+
|
150
150
|
|
151
151
|
pathToMake=pathPrefix + '/' + packagedFile['name'] #构造文件名
|
152
152
|
|
153
153
|
puts("data: #{victoriaFreshData}, path: #{pathToMake}") #Debug
|
154
154
|
|
155
155
|
begin #创建符号链接
|
156
|
+
unless victoriaFreshData.nil?
|
156
157
|
FileUtils.symlink(victoriaFreshData, pathToMake, force: true) #创建符号链接
|
158
|
+
else # The symlink target content is nil. exz file was broken.
|
159
|
+
puts "The symbolic link target is nil. The exz file might be broken." # warning.
|
160
|
+
end
|
157
161
|
rescue Errno::EACCES => e #权限受限
|
158
|
-
|
162
|
+
puts "Rescued by Errno::EACCES statement. #{pathToMake}" #报告错误
|
159
163
|
end #begin #创建符号链接
|
160
164
|
|
161
165
|
permissionNumber=packagedFile['permission'] #获取权限数字
|
@@ -169,6 +173,8 @@ class VictoriaFresh
|
|
169
173
|
puts 'File.lchmod not implemented' #Debug
|
170
174
|
rescue Errno::ENOTSUP => e
|
171
175
|
puts "Rescued by Errno::ENOTSUP statement. #{pathToMake}" #报告错误
|
176
|
+
rescue Errno::ENOENT => e
|
177
|
+
puts "Rescued by Errno::ENOENT statement. #{pathToMake}" #报告错误
|
172
178
|
end #begin #尝试修改链接本身的权限
|
173
179
|
end #if (permissionNumber.nil?) #不带权限字段
|
174
180
|
end #def makeSymlinkExternalDataFile(pathPrefix, packagedFile)
|
@@ -202,13 +208,13 @@ class VictoriaFresh
|
|
202
208
|
end #begin #尝试修改链接本身的权限
|
203
209
|
end #if (permissionNumber.nil?) #不带权限字段
|
204
210
|
end #def makeSymlink(pathPrefix, packagedFile, contentString) #创建符号链接
|
205
|
-
|
211
|
+
|
206
212
|
def getTimeObject(packagedFile) #构造时间戳对象
|
207
213
|
# seconds=packagedFile.timestamp.seconds #获取秒数
|
208
|
-
seconds=packagedFile['timestamp']['seconds']
|
214
|
+
seconds=packagedFile['timestamp']['seconds'] # 获取秒数
|
209
215
|
|
210
216
|
# microSeconds=packagedFile.timestamp.nanos/ 1000.0 #获取毫秒数
|
211
|
-
microSeconds=packagedFile['timestamp']['nanos'] / 1000.0
|
217
|
+
microSeconds=packagedFile['timestamp']['nanos'] / 1000.0 # 获取微秒数
|
212
218
|
|
213
219
|
timeObject=Time.at(seconds, microSeconds) #构造时间对象
|
214
220
|
|
@@ -310,7 +316,7 @@ class VictoriaFresh
|
|
310
316
|
@contentString=@contentString[@diskFlushSize, @contentString.length-@diskFlushSize] #留下剩余的部分
|
311
317
|
|
312
318
|
if (@diskMultiFile) #多个磁盘文件
|
313
|
-
@diskWriteFileObject=File.new(@diskFileName+@currentDiskFlushSuffix.to_s, 'wb') #打开文件
|
319
|
+
@diskWriteFileObject=File.new(@diskFileName+@currentDiskFlushSuffix.to_s+'.v', 'wb') #打开文件
|
314
320
|
|
315
321
|
@currentDiskFlushSuffix=@currentDiskFlushSuffix+1 #增加计数
|
316
322
|
|
@@ -340,7 +346,7 @@ class VictoriaFresh
|
|
340
346
|
@contentString="" #字符串清空
|
341
347
|
|
342
348
|
if (@diskMultiFile) #多个磁盘文件
|
343
|
-
@diskWriteFileObject=File.new(@diskFileName+@currentDiskFlushSuffix.to_s, 'wb') #打开文件
|
349
|
+
@diskWriteFileObject=File.new(@diskFileName+@currentDiskFlushSuffix.to_s+'.v', 'wb') #打开文件
|
344
350
|
|
345
351
|
@currentDiskFlushSuffix=@currentDiskFlushSuffix+1 #增加计数
|
346
352
|
|
@@ -411,7 +417,7 @@ class VictoriaFresh
|
|
411
417
|
if (layer==0) #最外层
|
412
418
|
if (@diskMultiFile) #要写多个文件
|
413
419
|
else #不写多个文件
|
414
|
-
@diskWriteFileObject=File.new(@diskFileName, 'wb') #打开文件
|
420
|
+
@diskWriteFileObject=File.new(@diskFileName+'.v', 'wb') #打开文件
|
415
421
|
end #if (@diskMultiFile) #要写多个文件
|
416
422
|
end #if (layer==0) #最外层
|
417
423
|
end #if (@diskFlush) #要向磁盘写入文件s
|
data/victoriafresh.example.rb
CHANGED
@@ -9,9 +9,13 @@ else #指定了命令行参数。
|
|
9
9
|
|
10
10
|
$clipDownloader=VictoriaFresh.new #创建下载器。
|
11
11
|
|
12
|
-
$clipDownloader.diskFlush=false
|
13
|
-
$clipDownloader.
|
14
|
-
|
12
|
+
# $clipDownloader.diskFlush=false # Do not write disk cache.
|
13
|
+
$clipDownloader.diskFlush=true #write disk cache.
|
14
|
+
|
15
|
+
# $clipDownloader.diskMultiFile = true # Write multiple files
|
16
|
+
$clipDownloader.diskMultiFile = false # Write single file
|
17
|
+
|
18
|
+
$clipDownloader.diskFileName='victoriafreshdata' #磁盘文件名前缀
|
15
19
|
$clipDownloader.diskFlushSize=32*1024*1024 #磁盘文件大小
|
16
20
|
|
17
21
|
victoriaFresh,victoriaFreshData=$clipDownloader.checkOnce($rootPath) #打包该目录树。
|
@@ -27,7 +31,7 @@ else #指定了命令行参数。
|
|
27
31
|
|
28
32
|
victoriaFreshFile.close #关闭文件。
|
29
33
|
|
30
|
-
victoriaFreshDataFile=File.new("victoriafreshdata.v","wb") #数据文件。
|
31
|
-
victoriaFreshDataFile.syswrite(victoriaFreshData) #写入文件。
|
32
|
-
victoriaFreshDataFile.close #关闭文件。
|
34
|
+
# victoriaFreshDataFile=File.new("victoriafreshdata.v","wb") #数据文件。
|
35
|
+
# victoriaFreshDataFile.syswrite(victoriaFreshData) #写入文件。
|
36
|
+
# victoriaFreshDataFile.close #关闭文件。
|
33
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: VictoriaFreSh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2024.3.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hxcan Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hx_cbor
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.3.26
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: VictoriaFreSh
|