webpage_update_checker 1.0.0 → 1.1.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 +19 -1
- data/lib/webpage_update_checker/{judge.rb → client.rb} +1 -1
- data/lib/webpage_update_checker/version.rb +1 -1
- data/lib/webpage_update_checker.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: d2bee192848bb12321f3d4bb66533b292136a6d2668917de9f606a9a44ea080d
|
4
|
+
data.tar.gz: 95ce7313f61e8ad058c064fadc3460772155a006ba587a21d6027a32854c5cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad50f41b2a46758ba35545a11eb27e1e795a328ee9a99ca968a9b74eba1757a4aac0591c3386588e1adaaf828bd8bed707a1df10d99db5e17f06c0fdfd390d6f
|
7
|
+
data.tar.gz: f00ab47146876b62b340ef724c184e197552cfffc216b8cb9c033a4f6d64f3387f5a6217833fe87cb0574b11eed21d30311a80921ab705213592c9af60d248fb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@ $ bundle install
|
|
17
17
|
```ruby
|
18
18
|
require 'webpage_update_checker'
|
19
19
|
|
20
|
-
checker = WebpageUpdateChecker::
|
20
|
+
checker = WebpageUpdateChecker::Client.new
|
21
21
|
target_page_md5 = WebpageUpdateChecker::Methods::Md5.new(uri: 'http://www.ne.jp/asahi/pursuits/ootsuki/pc/X68k/x680x0.xhtml')
|
22
22
|
|
23
23
|
checker.current_diff_value(target_page_md5) #=> fb2eeb524e6b5637ef7fa4bed48f1d67
|
@@ -25,6 +25,24 @@ checker.updated?(target_page_md5, previous_diff_value: 'fb2eeb524e6b5637ef7fa4be
|
|
25
25
|
checker.updated?(target_page_md5, previous_diff_value: '12345678901234567890123456789012') #=> true (updated)
|
26
26
|
```
|
27
27
|
|
28
|
+
# Methods
|
29
|
+
You can use these `Methods`.
|
30
|
+
|
31
|
+
- LastModified
|
32
|
+
- Md5
|
33
|
+
- Sha1
|
34
|
+
- Sha256
|
35
|
+
- Sha384
|
36
|
+
- Sha512
|
37
|
+
|
38
|
+
# methods
|
39
|
+
You can use these methods in each `Methods`.
|
40
|
+
|
41
|
+
- `#updated?(checked_object, previous_diff_value:)`
|
42
|
+
- `#=> true or false`
|
43
|
+
- `#current_diff_value(checked_object)`
|
44
|
+
- `#=> object such as Time or String (MD5, SHA512...)`
|
45
|
+
|
28
46
|
# TODO
|
29
47
|
- [Coveralls](https://coveralls.io/)
|
30
48
|
- [Code Climate](https://codeclimate.com/)
|
@@ -2,7 +2,7 @@ require 'mechanize'
|
|
2
2
|
Dir[File.expand_path('methods', __dir__) << '/*.rb'].each { |file| require file }
|
3
3
|
|
4
4
|
module WebpageUpdateChecker
|
5
|
-
class
|
5
|
+
class Client
|
6
6
|
def updated?(checked_object, previous_diff_value:)
|
7
7
|
current_diff_value(checked_object) != previous_diff_value
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Osamu Takiya
|
@@ -254,7 +254,7 @@ files:
|
|
254
254
|
- bin/console
|
255
255
|
- bin/setup
|
256
256
|
- lib/webpage_update_checker.rb
|
257
|
-
- lib/webpage_update_checker/
|
257
|
+
- lib/webpage_update_checker/client.rb
|
258
258
|
- lib/webpage_update_checker/methods/last_modified.rb
|
259
259
|
- lib/webpage_update_checker/methods/md5.rb
|
260
260
|
- lib/webpage_update_checker/methods/sha1.rb
|