ZReviewTender 1.2.3 → 1.2.6
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/.version +1 -1
- data/bin/ZReviewTender +49 -41
- data/lib/ZLogger.rb +0 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2868c84fd65d362c6cd62029ec951c924f456f09688d428735186bc8ca41caa
|
4
|
+
data.tar.gz: 8ab6cb9dda7d91c2306201bbb4ee89f76e02686680d0076739d6a7e1677f9ea7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ffe7ed942dee3fc9ed74de25166248460882818af03da9c10deb5a952296e651a5f6e2897c64635a637778061472d31897c391e9e7256f9817f9b5f298ed6a
|
7
|
+
data.tar.gz: f930bd703f6b91ab4034ff0de3815347e5199bea66bb3f7a594d7d0eb9ae93ec6dc328981799f15bfb668ac92aee9c871501b65d01af0f2555a71de01819f96c
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.6
|
data/bin/ZReviewTender
CHANGED
@@ -126,7 +126,17 @@ class Main
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
-
opts.on('-
|
129
|
+
opts.on('-d', '--delete', 'delete latest check timestamp log file.(factory reset)') do
|
130
|
+
FileUtils.rm_rf("#{basePath}/latestCheckTimestamp/")
|
131
|
+
Helper.createDirIfNotExist("#{basePath}/latestCheckTimestamp/")
|
132
|
+
if !File.exists?("#{basePath}/latestCheckTimestamp/.keep")
|
133
|
+
File.open("#{basePath}/latestCheckTimestamp/.keep", 'w') { |file| file.write("") }
|
134
|
+
end
|
135
|
+
|
136
|
+
puts "Clean all latest check timestamp log file in /latestCheckTimestamp success."
|
137
|
+
end
|
138
|
+
|
139
|
+
opts.on('-v', '--version', 'show current version of ZReivewTender') do
|
130
140
|
version = Version.new
|
131
141
|
puts "Current ZReviewTender Version: #{version.getLocalVersion()}"
|
132
142
|
|
@@ -160,43 +170,38 @@ class Main
|
|
160
170
|
private
|
161
171
|
def parseConfigYMLFile(configFilePath)
|
162
172
|
configYMLObj = YAML.load_file(configFilePath)
|
163
|
-
|
164
|
-
platform = Helper.unwrapRequiredParameter(configYMLObj, 'platform')
|
173
|
+
platform = Helper.unwrapRequiredParameter(configYMLObj, 'platform')
|
165
174
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
175
|
+
fetcher = nil
|
176
|
+
if platform.downcase == "apple"
|
177
|
+
fetcher = AppleFetcher.new(AppleConfig.new(configYMLObj, configFilePath, ENV['PWD'] || ::Dir.pwd))
|
178
|
+
elsif platform.downcase == "android"
|
179
|
+
fetcher = AndroidFetcher.new(AndroidConfig.new(configYMLObj, configFilePath, ENV['PWD'] || ::Dir.pwd))
|
180
|
+
else
|
181
|
+
raise "unknow platform #{platform} in yml file #{configFilePath}."
|
182
|
+
end
|
174
183
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
184
|
+
processors = Helper.unwrapRequiredParameter(configYMLObj, 'processors')
|
185
|
+
if processors.nil?
|
186
|
+
processors = []
|
187
|
+
end
|
179
188
|
|
180
|
-
|
181
|
-
|
182
|
-
|
189
|
+
if processors.length < 1
|
190
|
+
raise "must specify/enable at least one processor."
|
191
|
+
end
|
183
192
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
end
|
189
|
-
processorClass = Helper.unwrapRequiredParameter(value, "class")
|
190
|
-
require "Processors/#{processorClass}"
|
191
|
-
fetcher.registerProcessor(eval("#{processorClass}.new(#{value}, '#{configFilePath}', '#{ENV['PWD'] || ::Dir.pwd}')"))
|
193
|
+
processors.each do |processor|
|
194
|
+
processor.each do |key, value|
|
195
|
+
if value["enable"] != true
|
196
|
+
next
|
192
197
|
end
|
198
|
+
processorClass = Helper.unwrapRequiredParameter(value, "class")
|
199
|
+
require "Processors/#{processorClass}"
|
200
|
+
fetcher.registerProcessor(eval("#{processorClass}.new(#{value}, '#{configFilePath}', '#{ENV['PWD'] || ::Dir.pwd}')"))
|
193
201
|
end
|
202
|
+
end
|
194
203
|
|
195
|
-
|
196
|
-
return fetcher
|
197
|
-
rescue => e
|
198
|
-
raise "#{e.message} in yml file #{configFilePath}."
|
199
|
-
end
|
204
|
+
return fetcher
|
200
205
|
end
|
201
206
|
end
|
202
207
|
|
@@ -212,14 +217,17 @@ begin
|
|
212
217
|
puts "#If this is helpful, please help to star the repo or recommend it to your friends."
|
213
218
|
rescue => e
|
214
219
|
logger = ZLogger.new(ENV['PWD'] || ::Dir.pwd)
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
logger.logError(
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
puts
|
224
|
-
puts
|
220
|
+
errorMessage = "#Error Message: #{e.message}\n"
|
221
|
+
errorMessage += "#Error Class: #{e.class}\n"
|
222
|
+
errorMessage += "#Backtrace Start#\n#{e.backtrace.join("\n")}\n#Backtrace End#\n"
|
223
|
+
logger.logError(errorMessage)
|
224
|
+
|
225
|
+
puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
226
|
+
puts "XXXXX Excute Failed, Error Occurred! XXXXX"
|
227
|
+
puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
228
|
+
puts "X https://github.com/ZhgChgLi/ZReviewTender"
|
229
|
+
puts "X Please create an issue on above repo, and provide error log, thanks!"
|
230
|
+
puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
231
|
+
|
232
|
+
raise e
|
225
233
|
end
|
data/lib/ZLogger.rb
CHANGED
@@ -12,22 +12,16 @@ class ZLogger
|
|
12
12
|
|
13
13
|
def logError(message)
|
14
14
|
result = "#{caller[0]}: #{message}"
|
15
|
-
|
16
|
-
puts "Error: #{result}"
|
17
15
|
logger.error(result)
|
18
16
|
end
|
19
17
|
|
20
18
|
def logWarn(message)
|
21
19
|
result = "#{caller[0]}: #{message}"
|
22
|
-
|
23
|
-
puts "Warning: #{result}"
|
24
20
|
logger.warn(result)
|
25
21
|
end
|
26
22
|
|
27
23
|
def logInfo(message)
|
28
24
|
result = "#{caller[0]}: #{message}"
|
29
|
-
|
30
|
-
puts "Info: #{result}"
|
31
25
|
logger.info(result)
|
32
26
|
end
|
33
27
|
end
|