VictoriaFreSh 2020.7.23 → 2020.7.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 +31 -2
- 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: c5421a13a3343b2a3620f6c7aa85e427b71b724dbd918bad5344348e436593b3
|
4
|
+
data.tar.gz: c00bf9431e1888e2278fea7fdf0bf6a516dcb645a79b1b9b308e8111eb26d16b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d31a111f8e989a351699c25d7b6b9170cddb8a090d1b1b280ef2b6c8495fbe6424d340499791b6f3b55fac772fca7b99a353f901e39a8eb75c7d307705f46495
|
7
|
+
data.tar.gz: 0aa184b262b60cdcca7c0c153b2f7d711658ab78a39a9b14fb834efbb70d9b70690c7d590f80f2fb9391aa57be7f1787dfa325029c335cc0fa59a94590586ba4
|
data/lib/victoriafresh.rb
CHANGED
@@ -9,11 +9,40 @@ class VictoriaFresh
|
|
9
9
|
|
10
10
|
puts packagedFile #Debug
|
11
11
|
|
12
|
-
releaseFile(packagedFile, contentString) #释放一个文件
|
12
|
+
releaseFile('.', packagedFile, contentString) #释放一个文件
|
13
13
|
end #def releaseFiles(victoriaFreshPackagedFile, contentString) #释放目录树
|
14
14
|
|
15
|
-
def
|
15
|
+
def writeFile(pathPrefix, packagedFile, contentString) #写入文件
|
16
|
+
victoriaFreshData=contentString[packagedFile.file_start_index, file_length] #获取内容
|
17
|
+
|
18
|
+
victoriaFreshDataFile=File.new(pathPrefix + '/' + packagedFile.name , "wb") #数据文件。
|
19
|
+
victoriaFreshDataFile.syswrite(victoriaFreshData) #写入文件。
|
20
|
+
victoriaFreshDataFile.close #关闭文件。
|
21
|
+
|
22
|
+
end #writeFile(pathPrefix, packagedFile, contentString) #写入文件
|
23
|
+
|
24
|
+
def makeDirectory(pathPrefix, packagedFile) #创建目录
|
25
|
+
Dir.mkdir(File.join(pathPrefix, packagedFile.name)) #=> 0
|
26
|
+
|
27
|
+
end #makeDirectory(pathPrefix, packagedFile) #创建目录
|
28
|
+
|
29
|
+
def releaseFile( pathPrefix, packagedFile, contentString) #释放一个文件
|
16
30
|
puts packagedFile.name #Debug
|
31
|
+
|
32
|
+
if packagedFile.is_file #是文件,则直接写入文件
|
33
|
+
writeFile(pathPrefix, packagedFile, contentString) #写入文件
|
34
|
+
else #是目录,则创建目录,并递归处理
|
35
|
+
makeDirectory(pathPrefix, packagedFile) #创建目录
|
36
|
+
|
37
|
+
direcotryPathPrefix=pathPrefix + '/' + packagedFile.name #构造针对该目录的路径前缀
|
38
|
+
|
39
|
+
subFiles=packagedFile.sub_files #获取子文件列表。
|
40
|
+
|
41
|
+
subFiles.each do |currentSubFile| #一个个子文件地释放
|
42
|
+
releaseFile(direcotryPathPrefix, currentSubFile, contentString) #释放子文件
|
43
|
+
end #subFiles.each do |currentSubFile| #一个个子文件地释放
|
44
|
+
|
45
|
+
end #if packagedFile.is_file #是文件,则直接写入文件
|
17
46
|
end #def releaseFile(packagedFile, contentString) #释放一个文件
|
18
47
|
|
19
48
|
def checkOnce(directoryPath,startIndex=0) #打包一个目录树。
|
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.7.
|
4
|
+
version: 2020.7.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: 2020-07-
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: beefcake
|