wgit 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO.txt +1 -1
- data/lib/wgit/crawler.rb +4 -0
- data/lib/wgit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 542c84509de63fe870f23c81da2c377a03638cee9fe1950beb7135698bd9175d
|
4
|
+
data.tar.gz: b2131ef8b7beb32ba8bbb9eb1605e700c34d98210a126c2e24b23adafe35171f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3926c76974da55cf8bb179fead9b19805f6c15154925d72e76dc0b14cc3c17a14e64528c71bdcde33841ff56e2dd19d68b5d4a6b894991b08c142d1baac23fb
|
7
|
+
data.tar.gz: dcc9d04e67d7a2b93c8cb89be5610fa71f2c446e06bec99a099e0fe8a45a9e48db0aa2e2482f20a2ca00c8637cc6158e9be5720877190386249421e52dc02bc6
|
data/TODO.txt
CHANGED
@@ -19,7 +19,7 @@ Refactoring
|
|
19
19
|
- Replace method params with named parameters where applicable.
|
20
20
|
- Think about reducing the amount of method aliases, pick the best for the method def and remove the aliases?
|
21
21
|
- Mock (monkey patch) the 'mongo' gem's func. for speed in the tests.
|
22
|
-
- Refactor the
|
22
|
+
- Refactor the 3 main classes and their tests (where needed): Url, Document & Crawler.
|
23
23
|
|
24
24
|
Gem Publishing Checklist
|
25
25
|
------------------------
|
data/lib/wgit/crawler.rb
CHANGED
@@ -17,6 +17,9 @@ module Wgit
|
|
17
17
|
# The docs of the crawled @urls.
|
18
18
|
attr_reader :docs
|
19
19
|
|
20
|
+
# The Net::HTTPResponse of the most recently crawled URL or nil.
|
21
|
+
attr_reader :last_response
|
22
|
+
|
20
23
|
# Initializes the Crawler by setting the @urls and @docs.
|
21
24
|
#
|
22
25
|
# @param urls [*Wgit::Url] The URLs to crawl.
|
@@ -149,6 +152,7 @@ module Wgit
|
|
149
152
|
# ignored and nil will be returned. Otherwise, the HTML is returned.
|
150
153
|
def fetch(url)
|
151
154
|
response = resolve(url)
|
155
|
+
@last_response = response
|
152
156
|
response.body.empty? ? nil : response.body
|
153
157
|
rescue Exception => ex
|
154
158
|
Wgit.logger.debug(
|
data/lib/wgit/version.rb
CHANGED