miteru 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miteru/feeds/ayashige.rb +3 -3
- data/lib/miteru/kit.rb +7 -2
- data/lib/miteru/notifier.rb +1 -1
- 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: 2217ef5ac9ed2060203df9f5edebbac779fbebc53e4418f54de6d4b080ee81fc
|
4
|
+
data.tar.gz: 45c934a406c619b1d1cc9d03a00103ae2b732460ca70877953aaac2d36d3b0e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ebfc42660abedfa61a7e931e0d863b03fc50d615cfe0c81db10c0473ae8e0908619c5bcbc656e48784d40b5ccc5b98d616efe467d2a68ecca1bb57415bacfb
|
7
|
+
data.tar.gz: a74accbf1d3949e8211792e02c68e6e6911acbe2cc0cd113459eb812bad29ae0dc4c434f56009a1e49fa255d58bfc5485b9cbe8e3d6e936fef68e23d671d7d86
|
@@ -7,13 +7,13 @@ module Miteru
|
|
7
7
|
class Feeds
|
8
8
|
class Ayashige < Feed
|
9
9
|
HOST = "ayashige.herokuapp.com"
|
10
|
-
URL = "https://#{HOST}"
|
10
|
+
URL = "https://#{HOST}"
|
11
11
|
|
12
12
|
def urls
|
13
|
-
url = url_for("/
|
13
|
+
url = url_for("/api/v1/domains/")
|
14
14
|
res = JSON.parse(get(url))
|
15
15
|
|
16
|
-
domains = res.map { |item| item["
|
16
|
+
domains = res.map { |item| item["fqdn"] }
|
17
17
|
domains.map do |domain|
|
18
18
|
[
|
19
19
|
"https://#{domain}",
|
data/lib/miteru/kit.rb
CHANGED
@@ -45,8 +45,12 @@ module Miteru
|
|
45
45
|
"#{base_dir}/#{filename_to_download}"
|
46
46
|
end
|
47
47
|
|
48
|
+
def downloaded?
|
49
|
+
File.exist?(filepath_to_download)
|
50
|
+
end
|
51
|
+
|
48
52
|
def filesize
|
49
|
-
return nil unless
|
53
|
+
return nil unless downloaded?
|
50
54
|
|
51
55
|
File.size filepath_to_download
|
52
56
|
end
|
@@ -54,7 +58,8 @@ module Miteru
|
|
54
58
|
def filename_with_size
|
55
59
|
return filename unless filesize
|
56
60
|
|
57
|
-
|
61
|
+
kb = (filesize.to_f / 1024.0).ceil
|
62
|
+
"#{filename}(#{kb}KB)"
|
58
63
|
end
|
59
64
|
|
60
65
|
def id
|
data/lib/miteru/notifier.rb
CHANGED
@@ -7,7 +7,7 @@ module Miteru
|
|
7
7
|
class Notifier
|
8
8
|
def notify(url:, kits:, message:)
|
9
9
|
attachement = Attachement.new(url)
|
10
|
-
kits = kits.select(&:
|
10
|
+
kits = kits.select(&:downloaded?)
|
11
11
|
|
12
12
|
if notifiable? && kits.any?
|
13
13
|
notifier = Slack::Notifier.new(Miteru.configuration.slack_webhook_url, channel: Miteru.configuration.slack_channel)
|
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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|