miteru 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miteru/kit.rb +11 -3
- 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: 89102143e9e405545e94b50da7b81b90c85ae9612c8c914d4b50b6d09ca2e023
|
4
|
+
data.tar.gz: 2d6e60e6301425b9ceb8ed7cf103caab144f2ddab4fdd3872ef3f332a6667e37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df145d910400efc069d07c718943560a064b5d9fff849fb695795bf49b1d30681e6c31946172f2cd0e7508ca46ded7ff93d2935e48fc6dc970e1817d6e6348c
|
7
|
+
data.tar.gz: 70057c7c2451f4631bfda279431e40dfc86bc4931caa555141e607d0a2d73e5308bd0458ddc9046b1e0ccbe0329829ab8568202e8671c68146e5b6b4b6688705
|
data/lib/miteru/kit.rb
CHANGED
@@ -14,7 +14,7 @@ module Miteru
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def valid?;
|
17
|
-
valid_ext? &&
|
17
|
+
valid_ext? && reachable_and_archive_file?
|
18
18
|
end
|
19
19
|
|
20
20
|
def extname
|
@@ -69,9 +69,17 @@ module Miteru
|
|
69
69
|
VALID_EXTENSIONS.include? extname
|
70
70
|
end
|
71
71
|
|
72
|
-
def reachable?
|
72
|
+
def reachable?(response)
|
73
|
+
response.status.success?
|
74
|
+
end
|
75
|
+
|
76
|
+
def archive_file?(response)
|
77
|
+
!response.content_type.mime_type.to_s.start_with? "text/"
|
78
|
+
end
|
79
|
+
|
80
|
+
def reachable_and_archive_file?
|
73
81
|
res = HTTPClient.head(url)
|
74
|
-
res
|
82
|
+
reachable?(res) && archive_file?(res)
|
75
83
|
rescue StandardError
|
76
84
|
false
|
77
85
|
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: 0.14.
|
4
|
+
version: 0.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|