VictoriaFreSh 2020.7.27 → 2020.7.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VictoriaFreSh/filemessage_pb.rb +24 -0
- data/lib/victoriafresh.rb +14 -2
- metadata +12 -12
- data/lib/VictoriaFreSh/filemessage.pb.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f438ddc4c904ed9be3a4128759cdf20909a976a7ecc11f72472a3ff0e1bb2eb
|
4
|
+
data.tar.gz: cc22d6d130af0dc67c6dd1b0885e310f304e53f9b2a7943e81603d317b5658d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fae145f7b745661e2f9925f435dc5034a3ea01e6bb7967cdd8d6830214aa7c6f7f11ac4d5a3f90698e25bbeeacc32c442d753c0a886aacf57eb3179ba2bfa52
|
7
|
+
data.tar.gz: 98d277aa5b7032f59b89b9357fa343d4480c00533177c04718a650f4f354b9763b89aa10640e4b4b240e2d0f6cfd3d2da2a8345f787aeb7c1e8d280c2b717a4f
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: filemessage.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/protobuf/timestamp_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_message "com.stupidbeauty.victoriafresh.FileMessage" do
|
9
|
+
optional :name, :string, 1
|
10
|
+
repeated :sub_files, :message, 2, "com.stupidbeauty.victoriafresh.FileMessage"
|
11
|
+
optional :is_file, :bool, 3
|
12
|
+
optional :file_start_index, :int32, 5
|
13
|
+
optional :file_length, :int32, 6
|
14
|
+
optional :timestamp, :message, 8, "google.protobuf.Timestamp"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Com
|
19
|
+
module Stupidbeauty
|
20
|
+
module Victoriafresh
|
21
|
+
FileMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("com.stupidbeauty.victoriafresh.FileMessage").msgclass
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/victoriafresh.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
-
require File.dirname(__FILE__)+'/VictoriaFreSh/
|
4
|
+
require File.dirname(__FILE__)+'/VictoriaFreSh/filemessage_pb.rb'
|
5
5
|
|
6
6
|
class VictoriaFresh
|
7
7
|
def releaseFiles(victoriaFreshPackagedFileString, contentString) #释放目录树
|
@@ -39,6 +39,8 @@ class VictoriaFresh
|
|
39
39
|
def releaseFile( pathPrefix, packagedFile, contentString) #释放一个文件
|
40
40
|
puts packagedFile.name #Debug
|
41
41
|
|
42
|
+
puts packagedFile.timestamp #Debug
|
43
|
+
|
42
44
|
if packagedFile.is_file #是文件,则直接写入文件
|
43
45
|
writeFile(pathPrefix, packagedFile, contentString) #写入文件
|
44
46
|
else #是目录,则创建目录,并递归处理
|
@@ -56,7 +58,7 @@ class VictoriaFresh
|
|
56
58
|
end #def releaseFile(packagedFile, contentString) #释放一个文件
|
57
59
|
|
58
60
|
def checkOnce(directoryPath,startIndex=0) #打包一个目录树。
|
59
|
-
packagedFile=FileMessage.new #创建文件消息对象。
|
61
|
+
packagedFile=Com::Stupidbeauty::Victoriafresh::FileMessage.new #创建文件消息对象。
|
60
62
|
packagedFile.sub_files=[] #初始化数组。
|
61
63
|
|
62
64
|
directoryPathName=Pathname.new(directoryPath) #构造路径名字对象。
|
@@ -69,6 +71,16 @@ class VictoriaFresh
|
|
69
71
|
packagedFile.is_file=isFile #设置属性,是否是文件。
|
70
72
|
packagedFile.file_start_index=startIndex #记录文件内容的开始位置。
|
71
73
|
|
74
|
+
|
75
|
+
#记录时间戳:
|
76
|
+
mtimeStamp=File.mtime(directoryPath) #获取时间戳
|
77
|
+
puts direcotryPath #Dbug.
|
78
|
+
puts mtimeStamp #Debug
|
79
|
+
|
80
|
+
packagedFile.timestamp={} #时间戳
|
81
|
+
packagedFile.timestamp.seconds=mtimeStamp.tv_sec #设置秒数
|
82
|
+
packagedFile.timestamp.nanos=mtimeStamp.tv_nsec #设置纳秒数
|
83
|
+
|
72
84
|
if (isFile) #是文件,不用再列出其子文件了。
|
73
85
|
packagedFile.file_length=directoryPathName.size #记录文件的内容长度。
|
74
86
|
|
metadata
CHANGED
@@ -1,42 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: VictoriaFreSh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2020.7.
|
4
|
+
version: 2020.7.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hxcan Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: protobuf
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.0
|
20
17
|
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '3.10'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.10.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.2.0
|
30
27
|
- - "~>"
|
31
28
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
29
|
+
version: '3.10'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.10.2
|
33
33
|
description: Virtual file system.
|
34
34
|
email: caihuosheng@gmail.com
|
35
35
|
executables: []
|
36
36
|
extensions: []
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
|
-
- lib/VictoriaFreSh/
|
39
|
+
- lib/VictoriaFreSh/filemessage_pb.rb
|
40
40
|
- lib/victoriafresh.rb
|
41
41
|
- victoriafresh.example.rb
|
42
42
|
homepage: http://rubygems.org/gems/VictoriaFreSh
|
@@ -1,15 +0,0 @@
|
|
1
|
-
## Generated from filemessage.proto for com.stupidbeauty.victoriafresh
|
2
|
-
require "beefcake"
|
3
|
-
|
4
|
-
|
5
|
-
class FileMessage
|
6
|
-
include Beefcake::Message
|
7
|
-
end
|
8
|
-
|
9
|
-
class FileMessage
|
10
|
-
optional :name, :string, 1
|
11
|
-
repeated :sub_files, FileMessage, 2
|
12
|
-
optional :is_file, :bool, 3
|
13
|
-
optional :file_start_index, :int32, 5
|
14
|
-
optional :file_length, :int32, 6
|
15
|
-
end
|