ZReviewTender 1.0.7 → 1.1.1

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: b4e15499027773482cf0b32287e29bc453c00115dfa5816372a900ace9ba9ec2
4
- data.tar.gz: b9b916a755ee4957f3183019e7fc7fefb7999f2572629f10506f55d5f0198cf8
3
+ metadata.gz: 401f2fc6c474a7a9b49f4e09e9574ec9af12ba4e86666da4a8c51926d1f4dc8e
4
+ data.tar.gz: 81bcfd837a752fa6efff0f07131d8246eedf9c3feff8b585648a5cd9ba10524c
5
5
  SHA512:
6
- metadata.gz: 37ecac4e478add72f532ad4c70937d9f36b142897cfbddadf1cbc20c0d98d3c6a706d1b43873ab3290a91998e532ce6274cf63b97971e12301114225b427d458
7
- data.tar.gz: 63af7bf0f7b55db49f70ff277765e1049a61ee8f5b1e50cdf05776d1ce78732a15ac1670906ebe548cfd2c5041815cb4bc4d72e09e2f68a532a79e9773d73145
6
+ metadata.gz: 211bf7f2044c407689c4b96236b34801fc1c2dafe56fd23fca39accdc5e2d31345109dd2708a5aef246e5c1885542f1b549653357487b644018a8b96640f70ee
7
+ data.tar.gz: aa679ef890c73f22ee8cc3a143d1c4c6714d549193f763ef5bceb20b32bc788953c92324f0b6a7422eaba8633f2bd3e0b758ca10f1111cdd27d4906168b0841e
data/bin/ZReviewTender CHANGED
@@ -8,6 +8,7 @@ require "Models/AppleConfig"
8
8
  require "Models/AndroidConfig"
9
9
  require "Models/Processor"
10
10
  require "Helper"
11
+ require "ZLogger"
11
12
  require "AppleFetcher"
12
13
  require "AndroidFetcher"
13
14
  require "optparse"
@@ -94,8 +95,6 @@ class Main
94
95
  processors = Helper.unwrapRequiredParameter(configYMLObj, 'processors')
95
96
  if processors.nil?
96
97
  processors = []
97
- else
98
- processors = processors.select{ |processor| processor.select{ |key, value| value["enable"] == true }}
99
98
  end
100
99
 
101
100
  if processors.length < 1
@@ -104,6 +103,9 @@ class Main
104
103
 
105
104
  processors.each do |processor|
106
105
  processor.each do |key, value|
106
+ if value["enable"] != true
107
+ next
108
+ end
107
109
  processorClass = Helper.unwrapRequiredParameter(value, "class")
108
110
  require "Processors/#{processorClass}"
109
111
  fetcher.registerProcessor(eval("#{processorClass}.new(#{value}, '#{configFilePath}', '#{ENV['PWD'] || ::Dir.pwd}')"))
@@ -121,6 +123,15 @@ end
121
123
  begin
122
124
  Main.new()
123
125
  rescue => e
124
- puts "#Error: #{e.class} #{e.message}\n"
125
- puts e.backtrace
126
- end
126
+ logger = ZLogger.new(ENV['PWD'] || ::Dir.pwd)
127
+ title = "#Error: #{e.class} #{e.message}"
128
+ body = e.backtrace
129
+
130
+ logger.logError("===RUNTIME EXCEPTION START===")
131
+ logger.logError(title)
132
+ logger.logError(body)
133
+ logger.logError("===RUNTIME EXCEPTION END===")
134
+
135
+ puts title
136
+ puts body
137
+ end
data/lib/Models/Review.rb CHANGED
@@ -3,15 +3,15 @@ $lib = File.expand_path('../', File.dirname(__FILE__))
3
3
  class Review
4
4
  attr_accessor :platform, :id, :userName, :rating, :title, :body, :createdDateTimestamp, :url, :appVersion, :territory
5
5
  def initialize(platform, id, userName, rating, title, body, createdDateTimestamp, url, appVersion, territory)
6
- @platform = platform
7
- @id = id
8
- @userName = userName
9
- @rating = rating
10
- @title = title
11
- @body = body
12
- @createdDateTimestamp = createdDateTimestamp
13
- @url = url
14
- @appVersion = appVersion
15
- @territory = territory
6
+ @platform = platform # 來源平台 android or apple
7
+ @id = id # review id
8
+ @userName = userName # reviewer
9
+ @rating = rating # 給予的 rating, 1~5
10
+ @title = title # review 標題 (android 無此資料)
11
+ @body = body # review 內容
12
+ @createdDateTimestamp = createdDateTimestamp # review 建立時間
13
+ @url = url # 前往 review 的連結 (apple 不提供後台指定到某個 review 的連結)
14
+ @appVersion = appVersion # app 版本號
15
+ @territory = territory # apple: 地區(TWN/JPN...), android: 語系(zh-tw/en...)
16
16
  end
17
17
  end
@@ -77,6 +77,7 @@ class SlackProcessor < Processor
77
77
 
78
78
  result = request(payload)
79
79
  if !result[:ok]
80
+ logger.logError(payload)
80
81
  logger.logError(result)
81
82
  if result[:message] == "ratelimited"
82
83
  sleep(1)
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.0.7
4
+ version: 1.1.1
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-09 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-http
@@ -109,6 +109,6 @@ requirements: []
109
109
  rubygems_version: 3.0.3
110
110
  signing_key:
111
111
  specification_version: 4
112
- summary: ZReviewTender uses brand new App Store & Google Play API to resend App reviews
113
- to your Slack channel automatically.
112
+ summary: ZReviewTender uses brand new App Store & Google Play API to fetch App reviews
113
+ and integration your workflow.
114
114
  test_files: []