VictoriaFreSh 2020.8.28 → 2020.8.29
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 +6 -11
- 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: 62522d43b651b6ba58ed738f1a0e72b2c0f66ca24f8329cb60dc6e6807be782a
|
4
|
+
data.tar.gz: e4c61f51e78420aac6c6d29090b4fefa627479415671a0a1df919b735277baa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc5531da173296c23d942ed4690d71dda0b7748beae9fd1923e47c91011f544b1efea697d7ac330930d3d3f40455af1ae846258372223c61cdab918a020c5551
|
7
|
+
data.tar.gz: 0a43292024c056a5af88b210728fc9345533de397d23078134b21429c61b63812945eaab823bac890c06ed4f60b77d7f9b024d6328a8e58768cd9f60d102e0cd
|
data/lib/victoriafresh.rb
CHANGED
@@ -27,7 +27,7 @@ class VictoriaFresh
|
|
27
27
|
# pathToMake=pathPrefix + '/' + packagedFile.name #构造文件名
|
28
28
|
pathToMake=pathPrefix + '/' + packagedFile['name'] #构造文件名
|
29
29
|
|
30
|
-
victoriaFreshDataFile=File.new(pathToMake , "wb") #数据文件。
|
30
|
+
victoriaFreshDataFile=File.new(pathToMake , "wb", packagedFile['permission']) #数据文件。
|
31
31
|
victoriaFreshDataFile.syswrite(victoriaFreshData) #写入文件。
|
32
32
|
victoriaFreshDataFile.close #关闭文件。
|
33
33
|
|
@@ -51,6 +51,8 @@ class VictoriaFresh
|
|
51
51
|
puts("data: #{victoriaFreshData}, path: #{pathToMake}") #Debug
|
52
52
|
|
53
53
|
FileUtils.symlink(victoriaFreshData, pathToMake, force: true) #创建符号链接
|
54
|
+
|
55
|
+
File.lchmod(packagedFile['permission'], pathToMake) #设置权限
|
54
56
|
end #def makeSymlink(pathPrefix, packagedFile, contentString) #创建符号链接
|
55
57
|
|
56
58
|
def getTimeObject(packagedFile) #构造时间戳对象
|
@@ -82,7 +84,7 @@ class VictoriaFresh
|
|
82
84
|
|
83
85
|
|
84
86
|
FileUtils.touch pathToMake, :mtime => timeObject #设置修改时间
|
85
|
-
|
87
|
+
File.chmod(packagedFile['permission'], pathToMake) #设置权限
|
86
88
|
end #makeDirectory(pathPrefix, packagedFile) #创建目录
|
87
89
|
|
88
90
|
def releaseFile( pathPrefix, packagedFile, contentString) #释放一个文件
|
@@ -115,16 +117,10 @@ class VictoriaFresh
|
|
115
117
|
end #def releaseFile(packagedFile, contentString) #释放一个文件
|
116
118
|
|
117
119
|
def checkOnce(directoryPath,startIndex=0) #打包一个目录树。
|
118
|
-
# packagedFile=Com::Stupidbeauty::Victoriafresh::FileMessage.new #创建文件消息对象。
|
119
120
|
packagedFile={} #创建文件消息对象。
|
120
121
|
|
121
|
-
# packagedFile.sub_files=[] #初始化数组。
|
122
122
|
packagedFile['sub_files'] = [] #加入到子文件列表中。
|
123
123
|
|
124
|
-
# packagedFile.sub_files=Google::Protobuf::RepeatedField.new(Com::Stupidbeauty::Victoriafresh::FileMessage, []) #初始化数组
|
125
|
-
# packagedFile.sub_files=Google::Protobuf::RepeatedField.new(Google::Protobuf::DescriptorPool.generated_pool.lookup("com.stupidbeauty.victoriafresh.FileMessage").msgclass, []) #初始化数组
|
126
|
-
|
127
|
-
|
128
124
|
directoryPathName=Pathname.new(directoryPath) #构造路径名字对象。
|
129
125
|
|
130
126
|
baseName=directoryPathName.basename.to_s #基本文件名。
|
@@ -144,17 +140,16 @@ class VictoriaFresh
|
|
144
140
|
#记录时间戳:
|
145
141
|
begin #读取时间戳
|
146
142
|
mtimeStamp=File.mtime(directoryPath) #获取时间戳
|
147
|
-
# puts mtimeStamp #Debug
|
148
143
|
|
149
144
|
packagedFile['timestamp']={} #时间戳
|
150
145
|
packagedFile['timestamp']['seconds']=mtimeStamp.tv_sec #设置秒数
|
151
146
|
packagedFile['timestamp']['nanos']=mtimeStamp.tv_nsec #设置纳秒数
|
152
|
-
|
147
|
+
|
148
|
+
packagedFile['permission']=(File.stat(directoryPath).mode & 07777 ) #设置权限信息
|
153
149
|
rescue Errno::ENOENT
|
154
150
|
|
155
151
|
end #begin #读取时间戳
|
156
152
|
|
157
|
-
|
158
153
|
if (isFile) #是文件,不用再列出其子文件了。
|
159
154
|
packagedFile['file_length']=directoryPathName.size #记录文件的内容长度。
|
160
155
|
|
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: 2020.8.
|
4
|
+
version: 2020.8.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-08-
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cbor
|