dircrawl 0.0.13 → 0.0.14

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dircrawl.rb +18 -17
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07c65c7f7cd69dcb98029a38d70098bb30e1d244
4
- data.tar.gz: dd5cc8606a8b722916053cc413febcccce8061cc
3
+ metadata.gz: 99a04d217d2ae8f295d5e7b71d702019128fa888
4
+ data.tar.gz: 27c211fce81a7649ac03c77158c25889b42a47ad
5
5
  SHA512:
6
- metadata.gz: d00b80695f80838f91fec5f6d0f956a1676e6c8c7540bfc68259895708fa57862401ae06ba08bb7239c399a03cee9e696520672484cafc04bca03b9b4851568a
7
- data.tar.gz: b943e3bb63a37df8a203c17e14c6f8c698c251267c784ae3a288290968b9c983ac712f31cc0dc485da22647bb966b6f58a08b2412187f9c439ea785b8bcfb905
6
+ metadata.gz: 092d8f4d0f1456bc83c9176ad82853f03b6272414881e946e12ed85730831434600ab1a59efe52ac4c55dcf2096ffb392ebf1ebc3ddb3583be01a3c55f2b23cf
7
+ data.tar.gz: 661c0f676837b758e827a34060ce599dfe62f6bd211d206a0caca87078c4ba378009ec6c47253d30df0cad9f7a8e35feff620a0f4ed8471fca132d7f354dbd36
data/lib/dircrawl.rb CHANGED
@@ -60,29 +60,30 @@ class DirCrawl
60
60
 
61
61
  begin
62
62
 
63
- # Check if processed file exists
64
- # Skip processing (if yes)
65
- if !File.exist?(get_write_dir(dir, file))
66
-
67
- # Process Extras
68
- if @extras_block != ""
69
- extras = @extras_block.call(@output_dir+"/")
70
- end
71
-
72
- # Now Process Main
73
- processed = @process_block.call(dir+"/"+file, *args)
74
- else
75
- puts "Processed file exists, skipping"
76
- puts " " + dir + file
77
- processed = File.read(get_write_dir(dir, file))
78
- end
63
+ # Check if processed file exists
64
+ # Skip processing (if yes)
65
+ if !File.exist?(get_write_dir(dir, file))
66
+
67
+ # Process Extras
68
+ if @extras_block != ""
69
+ extras = @extras_block.call(@output_dir+"/")
70
+ end
71
+
72
+ # Now Process Main
73
+ processed = @process_block.call(dir+"/"+file, *args)
74
+ else
75
+ puts "Processed file exists, skipping"
76
+ puts " " + dir + "/" + file
77
+ processed = File.read(get_write_dir(dir, file))
78
+ end
79
79
 
80
80
  rescue Exception => e # really catch any failures
81
81
  report_status("Error on file "+file+": "+e.to_s)
82
82
  if @failure_mode == "debug"
83
83
  binding.pry
84
84
  elsif @failure_mode == "log"
85
- IO.write(@output_dir+"/error_log.txt", file+"\n", mode: 'a')
85
+ error_file = dir + "/" + file + "\n"
86
+ IO.write(@output_dir+"/error_log.txt", error_file, mode: 'a')
86
87
  end
87
88
  end
88
89
 
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.13
4
+ version: 0.0.14
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-30 00:00:00.000000000 Z
12
+ date: 2017-01-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Run block on all files in dir
15
15
  email: shidash@shidash.com