miteru 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c858dd689d566a4a12270d7474b9174d60deeabb23f61e1a62440040558f0a3c
4
- data.tar.gz: 0f53873e358ab18712c0e9d7c5fc6b6cd863464b467d78e82983ca2386834115
3
+ metadata.gz: 4237f69872b2b40f63b836bd2d1b8e0826ba3657eab4317c838f683501e96d7f
4
+ data.tar.gz: be76c1e8725f4ec9caf72925cac19381316b5f5cd122eb0d880e965f70b95144
5
5
  SHA512:
6
- metadata.gz: 76359bf3d5883acdfdef815045d634a286be8985f21408f9f91349a7e048077309ab468d095d4b49e9e26b19018b4d280b2290beb8620b5d7729e1b9fc5d9586
7
- data.tar.gz: 9bb8d92dbb325a74c38a8f05a4ed5967831a70601597d6d45235d9a1571228dcfcc543e255628b763b977bf2a649b3976779a2765c8ba19dd174dc988d275320
6
+ metadata.gz: a3c89b717506b07ccec2e8e7ae4e304b1d82178cab4e4aa4de604634a24de5b6bb031e8448f61ec1898df95c123654b6232b662baf6c3745fecc038d563e34bc
7
+ data.tar.gz: 8ad79b11a7af94d0ebc279c86d46f445b7f0df0c79a40d01f19c99da79b17a5e5e795ac3f5af20f3c10c15c62ff432f1b634b25572aad454fc763463eea7e262
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "colorize"
4
+ require "slack-notifier"
5
+
3
6
  module Miteru
4
7
  module Notifiers
5
8
  class Slack < Base
@@ -12,10 +15,7 @@ module Miteru
12
15
  attachement = Attachement.new(website.url)
13
16
  kits = website.kits.select(&:downloaded?)
14
17
 
15
- if notifiable? && kits.any?
16
- notifier = Slack::Notifier.new(Miteru.configuration.slack_webhook_url, channel: Miteru.configuration.slack_channel)
17
- notifier.post(text: website.message.capitalize, attachments: attachement.to_a)
18
- end
18
+ notifier.post(text: website.message.capitalize, attachments: attachement.to_a) if notifiable? && kits.any?
19
19
 
20
20
  message = kits.any? ? website.message.colorize(:light_red) : website.message
21
21
  Miteru.logger.info "#{website.url}: #{message}"
@@ -24,6 +24,10 @@ module Miteru
24
24
  def notifiable?
25
25
  Miteru.configuration.slack_webhook_url? && Miteru.configuration.post_to_slack?
26
26
  end
27
+
28
+ def notifier
29
+ Slack::Notifier.new(Miteru.configuration.slack_webhook_url, channel: Miteru.configuration.slack_channel)
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Miteru
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miteru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-07 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler