webpage_update_checker 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/webpage_update_checker/methods/http_status_code.rb +16 -0
- data/lib/webpage_update_checker/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46e6b17d245cd2498f15e9c90cf27a0fe7eab44a5225df8b2f85e2ba1d0b3168
|
4
|
+
data.tar.gz: e0ddec03ded73b0ff25fb501dd4ff109116312a8b6d8e755bf760fa7c944620c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0bff916a00b5d212371a290815641d8157bec705f132a437f1c04a6a78fba26be6fe60395339b1d5dd018a8d8c97763db25a7b50aa1c05bd39c7f9f4df35ef1
|
7
|
+
data.tar.gz: f2b51da4b49bf233ab3c01b54fc2759d9222fc7706ab43974fef603abefdab023bca5f566ad6c6d026f5706989174a82321bac933a064fb2d86a11e68ab3b6ef
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -34,6 +34,7 @@ You can use these `Methods`.
|
|
34
34
|
- Sha256
|
35
35
|
- Sha384
|
36
36
|
- Sha512
|
37
|
+
- HttpStatusCode
|
37
38
|
|
38
39
|
# methods
|
39
40
|
You can use these methods in each `Methods`.
|
@@ -41,7 +42,7 @@ You can use these methods in each `Methods`.
|
|
41
42
|
- `#updated?(checked_object, previous_diff_value:)`
|
42
43
|
- `#=> true or false`
|
43
44
|
- `#current_diff_value(checked_object)`
|
44
|
-
- `#=> object such as Time or String (MD5, SHA512...)`
|
45
|
+
- `#=> object such as Time (LastModified) or String (MD5, SHA512...)`
|
45
46
|
|
46
47
|
# TODO
|
47
48
|
- [Coveralls](https://coveralls.io/)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module WebpageUpdateChecker
|
2
|
+
module Methods
|
3
|
+
class HttpStatusCode
|
4
|
+
def initialize(uri:)
|
5
|
+
@uri = uri
|
6
|
+
end
|
7
|
+
|
8
|
+
def current_diff_value
|
9
|
+
page = Mechanize.new.get(@uri)
|
10
|
+
page.code.to_i
|
11
|
+
rescue Mechanize::ResponseCodeError => e
|
12
|
+
e.response_code.to_i
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpage_update_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Osamu Takiya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -255,6 +255,7 @@ files:
|
|
255
255
|
- bin/setup
|
256
256
|
- lib/webpage_update_checker.rb
|
257
257
|
- lib/webpage_update_checker/client.rb
|
258
|
+
- lib/webpage_update_checker/methods/http_status_code.rb
|
258
259
|
- lib/webpage_update_checker/methods/last_modified.rb
|
259
260
|
- lib/webpage_update_checker/methods/md5.rb
|
260
261
|
- lib/webpage_update_checker/methods/sha1.rb
|