VictoriaFreSh 2022.2.19 → 2022.2.24
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.
- checksums.yaml +4 -4
- data/lib/victoriafresh.rb +30 -23
- 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: 2f5fdea807cbe79b7f0404fdb41c508b2396393723654dd3975c54843fef3f01
|
4
|
+
data.tar.gz: dd5231d5d40d010a76dda08e3202b03a39700e258530ff82c499924936641bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcdc261a46837e00d5a4e5ef8c8d3bc20de3d9f0175725e218dfa52bbf45b30b65c2c348cb95c8c4b63d9b22c655db42dca9909b9c69d42c8c3757dfeaa2952f
|
7
|
+
data.tar.gz: 41233b561bf390bee10d4ceddd1321c2cb8b54fa1002ab4e4b6b9036e4b196b135a61a27fbd6d1a7bf3ab8b657128c9eaab11daf332ea0912bdae85573acd144
|
data/lib/victoriafresh.rb
CHANGED
@@ -348,10 +348,9 @@ class VictoriaFresh
|
|
348
348
|
|
349
349
|
@diskWriteFileObject.close
|
350
350
|
else #单个磁盘文件
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
351
|
+
@diskWriteFileObject.syswrite(contentToWrite) #写入内容
|
352
|
+
|
353
|
+
@diskWriteFileObject.close #关闭文件
|
355
354
|
end #if (@diskMultiFile) #多个磁盘文件
|
356
355
|
end #if (isFinalPart) #是最后一部分
|
357
356
|
end #if (@diskFlush) #要做磁盘写入
|
@@ -360,24 +359,26 @@ class VictoriaFresh
|
|
360
359
|
# 读取要忽略的文件名列表。
|
361
360
|
def readIgnoreFileList (directoryPathName)
|
362
361
|
current_paragraph=[] # 列表
|
363
|
-
#陈欣
|
364
|
-
datastore= "#{directoryPathName.expand_path}/#{@ignoreFileName}" # 配置文件路径
|
365
|
-
|
366
|
-
begin
|
367
|
-
File.foreach(datastore).with_index do |line, _line_num|
|
368
|
-
if line.strip.empty? # 空行
|
369
|
-
else # 不是空行
|
370
|
-
current_paragraph << line.strip # 记录一行
|
371
|
-
end # if line.strip.empty? # 空行
|
372
|
-
end # File&.foreach(datastore).with_index do |line, _line_num|
|
373
362
|
|
374
|
-
|
375
|
-
|
363
|
+
if @ignoreFileName # 设置了忽略列表
|
364
|
+
#陈欣
|
365
|
+
datastore = "#{directoryPathName.expand_path}/#{@ignoreFileName}" # 配置文件路径
|
366
|
+
|
367
|
+
begin
|
368
|
+
File.foreach(datastore).with_index do |line, _line_num|
|
369
|
+
if line.strip.empty? # 空行
|
370
|
+
else # 不是空行
|
371
|
+
current_paragraph << line.strip # 记录一行
|
372
|
+
end # if line.strip.empty? # 空行
|
373
|
+
end # File&.foreach(datastore).with_index do |line, _line_num|
|
374
|
+
rescue Errno::ENOENT
|
375
|
+
end
|
376
|
+
end # if @ignoreFileName # 设置了忽略列表
|
376
377
|
|
377
378
|
current_paragraph
|
378
379
|
end
|
379
380
|
|
380
|
-
def timestampTooEarly(subFile)
|
381
|
+
def timestampTooEarly(subFile) # 是否文件时间过早。
|
381
382
|
result=false # 结果。
|
382
383
|
directoryPathName=subFile # 获取路径对象。
|
383
384
|
#isFile=directoryPathName.file? #是否是文件。
|
@@ -387,13 +388,19 @@ class VictoriaFresh
|
|
387
388
|
unless isDirectory # 如果是目录就跳过
|
388
389
|
#记录时间戳:
|
389
390
|
directoryPath=directoryPathName.expand_path # 获取完整路径。
|
390
|
-
mtimeStamp=File.mtime(directoryPath) #获取时间戳
|
391
|
-
|
392
|
-
fileTimestamp=mtimeStamp.tv_sec # 获取秒数
|
393
391
|
|
394
|
-
|
395
|
-
|
396
|
-
|
392
|
+
begin #读取时间戳
|
393
|
+
mtimeStamp=File.mtime(directoryPath) #获取时间戳
|
394
|
+
|
395
|
+
fileTimestamp=mtimeStamp.tv_sec # 获取秒数
|
396
|
+
|
397
|
+
#puts "path: #{directoryPath}, time stamp: #{fileTimestamp}, threshold: #{@timestampThreshold}" # debug
|
398
|
+
|
399
|
+
if (fileTimestamp< @timestampThreshold) # 文件的时间戳比阈值要小,过早了
|
400
|
+
result =true # 是过早了
|
401
|
+
end # if (fileTimestamp< @timestampThreshold) # 文件的时间戳比阈值要小,过早了
|
402
|
+
rescue Errno::ENOENT
|
403
|
+
end #begin #读取时间戳
|
397
404
|
end # unless isDirectory # 如果是目录就跳过
|
398
405
|
|
399
406
|
result # 返回结果
|
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: 2022.2.
|
4
|
+
version: 2022.2.24
|
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-02-
|
11
|
+
date: 2022-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hx_cbor
|