ZReviewTender 1.2.4 → 1.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ac1713093b3b22b1f08236ec02cb0a121e49c6cae6cd2522bcccbe8cbd6483c
4
- data.tar.gz: deee41c0761e5338f7bcd96d22a72407f2d46adeaa39d9ce17b96283475682e2
3
+ metadata.gz: d2943cc5872e966ed140f7300a31570056b8d11a08c24ef3f3e7af07612ebfa1
4
+ data.tar.gz: 7f6c610e0f1277d71f89d7678e754e9ae543865dd0942f1a2b77d40606f35538
5
5
  SHA512:
6
- metadata.gz: 8b5ee795276aeffeddbd2bbd4ec64e97a75af99e7e729b5550aba39c8593fc65efc32ba0f2bdc33840fbb68ac6d19871a8ac7db1fde6e19c354d544eb3f2c66a
7
- data.tar.gz: ad0ba15c85da2a6759f5af93e8f9080d7944be9c91201f2c30ca8b4d19fda3d40b4d8679ca0e93b509f93cab259bb574275a78ee84d7a69032febd442d99a10a
6
+ metadata.gz: 5ef30f02a3719a92277a2b4014f0cc074927aad1e3fe0466a4e1e2352baed8244a160d1800a7e188740357219e566389befb8f088d9deae6d02a933914ee7871
7
+ data.tar.gz: 5605793e165c0fc01c8ff1aa635eb7dda2c5894f75e590b03e44e6194d4ce5b237e50506925bc1a100dea887adc3369e95bc36f920b02d1c315e530acb507c8e
data/.version CHANGED
@@ -1 +1 @@
1
- 1.2.4
1
+ 1.2.7
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/AppleFetcher.rb CHANGED
@@ -79,7 +79,7 @@ class AppleFetcher < ReviewFetcher
79
79
  customerReviewsLink = nil
80
80
  break
81
81
  else
82
- url = "https://appstoreconnect.apple.com/apps/#{config.appID}/appstore/activity/ios/ratingsResponses"
82
+ url = "https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/#{config.appID}/ios/ratingsResponses"
83
83
  reviews.append(Review.new(nil, customerReviewID, customerReviewReviewerNickname, customerReviewRating, customerReviewTitle, customerReviewBody, customerReviewCreatedDateTimestamp, url, nil, customerReviewTerritory))
84
84
 
85
85
  # init first time, need first review to set as latestCheckTimestamp
@@ -205,4 +205,4 @@ class AppleFetcher < ReviewFetcher
205
205
  end
206
206
 
207
207
  end
208
- end
208
+ 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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZReviewTender
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-13 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-http