dircrawl 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dircrawl.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 718cb5898eb443d139f06327621d10b99f38cc1e
|
4
|
+
data.tar.gz: 5bbd222f8a39ff40f74cfcb4f018ed3d85b1761e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c85b08f37f4ceba18072d4bddb1fa0ad9f648f23de0737b031750d6bc55ef672bae6092d02b1b14ca2acf744c1f82709c955ccee8c72d0d10130f268427564
|
7
|
+
data.tar.gz: 376e288cfc6ec6bf6b52b5764a588e469a8fb26e835193436938cfd840097eb6b674999f1049cb3131ff074b6f462b3a16b6de8b3a19b44259b3dc032e43e89b
|
data/lib/dircrawl.rb
CHANGED
@@ -48,6 +48,7 @@ class DirCrawl
|
|
48
48
|
|
49
49
|
# Go to next dir
|
50
50
|
if File.directory?(dir+"/"+file)
|
51
|
+
report_status("Going to next directory: " + dir+"/"+file)
|
51
52
|
crawl_dir(dir+"/"+file, *args)
|
52
53
|
|
53
54
|
# Process file
|
@@ -70,6 +71,7 @@ class DirCrawl
|
|
70
71
|
end
|
71
72
|
|
72
73
|
rescue Exception => e # really catch any failures
|
74
|
+
report_status("Error on file "+file+": "+e.to_s
|
73
75
|
if @failure_mode == "debug"
|
74
76
|
binding.pry
|
75
77
|
elsif @failure_mode == "log"
|
@@ -102,6 +104,16 @@ class DirCrawl
|
|
102
104
|
end
|
103
105
|
end
|
104
106
|
|
107
|
+
# Report Harvester status message
|
108
|
+
def report_status(status_msg)
|
109
|
+
if @cm_url
|
110
|
+
curl_url = @cm_url+"/update_status"
|
111
|
+
c = Curl::Easy.http_post(curl_url,
|
112
|
+
Curl::PostField.content('selector_id', @selector_id),
|
113
|
+
Curl::PostField.content('status_message', status_msg))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
105
117
|
# Report results back to Harvester incrementally
|
106
118
|
def report_incremental(results, path)
|
107
119
|
curl_url = @cm_url+"/relay_results"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dircrawl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. C. McGrath
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-10-
|
12
|
+
date: 2016-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Run block on all files in dir
|
15
15
|
email: shidash@shidash.com
|