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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2bee192848bb12321f3d4bb66533b292136a6d2668917de9f606a9a44ea080d
4
- data.tar.gz: 95ce7313f61e8ad058c064fadc3460772155a006ba587a21d6027a32854c5cec
3
+ metadata.gz: 46e6b17d245cd2498f15e9c90cf27a0fe7eab44a5225df8b2f85e2ba1d0b3168
4
+ data.tar.gz: e0ddec03ded73b0ff25fb501dd4ff109116312a8b6d8e755bf760fa7c944620c
5
5
  SHA512:
6
- metadata.gz: ad50f41b2a46758ba35545a11eb27e1e795a328ee9a99ca968a9b74eba1757a4aac0591c3386588e1adaaf828bd8bed707a1df10d99db5e17f06c0fdfd390d6f
7
- data.tar.gz: f00ab47146876b62b340ef724c184e197552cfffc216b8cb9c033a4f6d64f3387f5a6217833fe87cb0574b11eed21d30311a80921ab705213592c9af60d248fb
6
+ metadata.gz: c0bff916a00b5d212371a290815641d8157bec705f132a437f1c04a6a78fba26be6fe60395339b1d5dd018a8d8c97763db25a7b50aa1c05bd39c7f9f4df35ef1
7
+ data.tar.gz: f2b51da4b49bf233ab3c01b54fc2759d9222fc7706ab43974fef603abefdab023bca5f566ad6c6d026f5706989174a82321bac933a064fb2d86a11e68ab3b6ef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpage_update_checker (1.1.0)
4
+ webpage_update_checker (1.2.0)
5
5
  mechanize
6
6
 
7
7
  GEM
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
@@ -1,3 +1,3 @@
1
1
  module WebpageUpdateChecker
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  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.1.0
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-13 00:00:00.000000000 Z
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