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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/bin/ZReviewTender +49 -41
  4. data/lib/ZLogger.rb +0 -6
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8306928e9340360ff41be79c80bea125f3eda543784b8f75a6a349d330ef66fa
4
- data.tar.gz: 1eb69b564b94944adfdc8d24453fe78b92e9909e2b0925b9bd1b5e20ef88ce79
3
+ metadata.gz: b2868c84fd65d362c6cd62029ec951c924f456f09688d428735186bc8ca41caa
4
+ data.tar.gz: 8ab6cb9dda7d91c2306201bbb4ee89f76e02686680d0076739d6a7e1677f9ea7
5
5
  SHA512:
6
- metadata.gz: efde5bc539774f293057f2c31a8e56acc28b8892df233d7aa6982333b0000eb2da5855991cc7bbe11a4c5e37299a4d1eed2274b37252bbab68cc9c918c6b1505
7
- data.tar.gz: 9ea645b482e197d89fb222352dac6d5ee4911d4e830ca1920e1f4b8a68a0686d2fc2cb13c1765dae0170840d1bc85109e46625cfa5e230222efaae17683381e9
6
+ metadata.gz: b4ffe7ed942dee3fc9ed74de25166248460882818af03da9c10deb5a952296e651a5f6e2897c64635a637778061472d31897c391e9e7256f9817f9b5f298ed6a
7
+ data.tar.gz: f930bd703f6b91ab4034ff0de3815347e5199bea66bb3f7a594d7d0eb9ae93ec6dc328981799f15bfb668ac92aee9c871501b65d01af0f2555a71de01819f96c
data/.version CHANGED
@@ -1 +1 @@
1
- 1.2.3
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('-v', '--versopm', 'show current version of ZReivewTender') do
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
- begin
164
- platform = Helper.unwrapRequiredParameter(configYMLObj, 'platform')
173
+ platform = Helper.unwrapRequiredParameter(configYMLObj, 'platform')
165
174
 
166
- fetcher = nil
167
- if platform.downcase == "apple"
168
- fetcher = AppleFetcher.new(AppleConfig.new(configYMLObj, configFilePath, ENV['PWD'] || ::Dir.pwd))
169
- elsif platform.downcase == "android"
170
- fetcher = AndroidFetcher.new(AndroidConfig.new(configYMLObj, configFilePath, ENV['PWD'] || ::Dir.pwd))
171
- else
172
- raise "unknow platform #{platform} in yml file #{configFilePath}."
173
- end
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
- processors = Helper.unwrapRequiredParameter(configYMLObj, 'processors')
176
- if processors.nil?
177
- processors = []
178
- end
184
+ processors = Helper.unwrapRequiredParameter(configYMLObj, 'processors')
185
+ if processors.nil?
186
+ processors = []
187
+ end
179
188
 
180
- if processors.length < 1
181
- raise "must specify/enable at least one processor."
182
- end
189
+ if processors.length < 1
190
+ raise "must specify/enable at least one processor."
191
+ end
183
192
 
184
- processors.each do |processor|
185
- processor.each do |key, value|
186
- if value["enable"] != true
187
- next
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
- title = "#Error: #{e.class} #{e.message}"
216
- body = e.backtrace
217
-
218
- logger.logError("===RUNTIME EXCEPTION START===")
219
- logger.logError(title)
220
- logger.logError(body)
221
- logger.logError("===RUNTIME EXCEPTION END===")
222
-
223
- puts title
224
- puts body
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZReviewTender
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi