dircrawl 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dircrawl.rb +12 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba3c1a9f1c59a90f094781a6becc3f221e9cfbe4
4
- data.tar.gz: 4bbbac56d9ee80eaf8e040b8133ae56f25d9da57
3
+ metadata.gz: 718cb5898eb443d139f06327621d10b99f38cc1e
4
+ data.tar.gz: 5bbd222f8a39ff40f74cfcb4f018ed3d85b1761e
5
5
  SHA512:
6
- metadata.gz: e2af2bdcdec751ab8c35bacaebbd8f6bad4adf400c933e1a68828fd9312fbbd88923e6947a4c0fed377c3e4879c8e74a04c482286f45c18d37ed0022395ed73e
7
- data.tar.gz: 61c5942ba31099659c5874da9850ae6f15441e1b5764b46cdee69e3329a4e57a4ee1b78c4bbb5130925d728e4178e0543f2d651b0da51d3742725bea0c3f8347
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.10
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-11 00:00:00.000000000 Z
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