app_status_notification 0.9.0.beta5 → 0.9.0.beta6

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: b7ed90768bf9ee842391ec5deedc30fc3e9bab4e20990a7fe21abf5910ffe551
4
- data.tar.gz: a254fed400a29c89dbdb22408624c375850e05dc5d879c8f459976d61c41092a
3
+ metadata.gz: 68396a55bf6a61b799c60d2e17cba6f41e0572c48a71b1c941a64c6c94cb03d0
4
+ data.tar.gz: 6866b37a861caf6729386a9fb4f29cf93881af63ed2a6dee62f153e4e0d4f391
5
5
  SHA512:
6
- metadata.gz: b0a0247d74e3862bc3db7629e7622af85538989060abec64000cbafec2fba3f80a62ef479f460e544393ab4cada677251a4308841a68d447ea2c6cc275bcae67
7
- data.tar.gz: cdd78f4f96a61fdd8ef7d33bc005b1586a9b644968cc98d4f68885b4d8437f18ccb42884de807d5fafc311e163f2647a5b5d6827c57db17b6c4992fdd831b7ed
6
+ metadata.gz: 88ea01ae8a53a80c2e1ce5d34b6c860827aee7ed91ec7c71ff00b5d36581a03277f6f4c9ee9ddf3ec52464ef03d0c0e5e28f8c9e67ed1b1c5e7783f4ac0ae378
7
+ data.tar.gz: ca8cf40562e62c7272e08b4ff007ecc5c71bfeb0f3b4f9bb794e660becac9463e37d08a6cd6ac3528d46b10ce3186b12893e520aca08dae7923e4d9eaaf5108e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_status_notification (0.9.0.beta5)
4
+ app_status_notification (0.9.0.beta6)
5
5
  activesupport (>= 6.0.3.1)
6
6
  anyway_config (>= 2.0.0)
7
7
  faraday (>= 1.0.1)
@@ -14,7 +14,7 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- activesupport (6.1.3)
17
+ activesupport (6.1.3.1)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 1.6, < 2)
20
20
  minitest (>= 5.1)
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['icyleaf']
11
11
  spec.email = ['icyleaf.cn@gmail.com']
12
12
 
13
- spec.summary = 'Get those App Store Connect notifications delivered directly to Slack.'
13
+ spec.summary = 'Get those App Store Connect notifications delivered directly to WeChat/Slack/Dingding etc.'
14
14
  spec.homepage = 'https://github.com/icyleaf/app_status_notification'
15
15
  spec.license = 'MIT'
16
16
 
@@ -11,6 +11,7 @@ module AppStatusNotification
11
11
 
12
12
  def initialize(options = {}) # rubocop:disable Style/OptionHash
13
13
  @options = options
14
+ @logger = @options[:logger]
14
15
  end
15
16
 
16
17
  # def send(message)
@@ -20,6 +21,12 @@ module AppStatusNotification
20
21
  # def on_error(exception)
21
22
  # fail Error, "Adapter does not supports #send"
22
23
  # end
24
+
25
+ private
26
+
27
+ def logger
28
+ @logger
29
+ end
23
30
  end
24
31
  end
25
32
  end
@@ -24,11 +24,10 @@ module AppStatusNotification
24
24
  }
25
25
 
26
26
  response = Net::HTTP.post(build_url, data.to_json, 'Content-Type' => 'application/json')
27
- ap response.code
28
- ap response.body
29
- # rescue => e
30
- # @exception = e
31
- # nil
27
+ logger.debug "#{self.class} response [#{response.code}] #{response.body}"
28
+ rescue => e
29
+ @exception = e
30
+ nil
32
31
  end
33
32
 
34
33
  def build_url
@@ -48,12 +48,10 @@ module AppStatusNotification
48
48
  end
49
49
 
50
50
  response = Net::HTTP.post(@webhook_url, data.to_json, 'Content-Type' => 'application/json')
51
-
52
- ap response.code
53
- ap response.body
54
- # rescue => e
55
- # @exception = e
56
- # nil
51
+ logger.debug "#{self.class} response [#{response.code}] #{response.body}"
52
+ rescue => e
53
+ @exception = e
54
+ nil
57
55
  end
58
56
 
59
57
  Notification.register self, :slack
@@ -11,7 +11,7 @@ module AppStatusNotification
11
11
 
12
12
  @exception = nil
13
13
 
14
- def initialize(**options)
14
+ def initialize(options)
15
15
  @webhook_url = URI(options['webhook_url'])
16
16
  super
17
17
  end
@@ -34,12 +34,10 @@ module AppStatusNotification
34
34
  }
35
35
 
36
36
  response = Net::HTTP.post(@webhook_url, data.to_json, 'Content-Type' => 'application/json')
37
-
38
- ap response.code
39
- ap response.body
40
- # rescue => e
41
- # @exception = e
42
- # nil
37
+ logger.debug "#{self.class} response [#{response.code}] #{response.body}"
38
+ rescue => e
39
+ @exception = e
40
+ nil
43
41
  end
44
42
 
45
43
  Notification.register self, :wecom, :wechat_work
@@ -321,6 +321,7 @@ module AppStatusNotification
321
321
  allowed_notifications.include?(nname)
322
322
 
323
323
  logger.debug t('logger.send_notification', name: nname, message: t(**message))
324
+ nargs[:logger] = logger
324
325
  Notification.send(message, nargs) unless config.dry?
325
326
  end
326
327
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppStatusNotification
4
- VERSION = '0.9.0.beta5'
4
+ VERSION = '0.9.0.beta6'
5
5
  end
@@ -7,11 +7,10 @@ module AppStatusNotification
7
7
  class Watchman
8
8
  include AppStatusNotification::I18nHelper
9
9
 
10
- def self.run(config_path = nil, store_path = '.')
10
+ def self.run(config_path = nil, store_path = nil)
11
11
  Anyway::Settings.default_config_path = config_path if config_path && Dir.exist?(config_path)
12
12
 
13
13
  config = Config.new
14
-
15
14
  if store_path
16
15
  FileUtils.mkdir_p(store_path)
17
16
  config.store_path = store_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_status_notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.beta5
4
+ version: 0.9.0.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -279,5 +279,6 @@ requirements: []
279
279
  rubygems_version: 3.1.4
280
280
  signing_key:
281
281
  specification_version: 4
282
- summary: Get those App Store Connect notifications delivered directly to Slack.
282
+ summary: Get those App Store Connect notifications delivered directly to WeChat/Slack/Dingding
283
+ etc.
283
284
  test_files: []