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 +4 -4
- data/lib/miteru/notifiers/slack.rb +8 -4
- data/lib/miteru/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4237f69872b2b40f63b836bd2d1b8e0826ba3657eab4317c838f683501e96d7f
|
4
|
+
data.tar.gz: be76c1e8725f4ec9caf72925cac19381316b5f5cd122eb0d880e965f70b95144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/miteru/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|