dircrawl 0.0.3 → 0.0.4

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 +11 -3
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a1d0872ea23fdf687f86c262492f3cc0780e423
4
- data.tar.gz: a5dc01e83439b4c0f57939bf7c89be4d4043a3ce
3
+ metadata.gz: a7e5690898b1e1871c98dadfd82f32cfbd585581
4
+ data.tar.gz: c6acafff26cd8e707d76e36c47b1af392d396272
5
5
  SHA512:
6
- metadata.gz: cf39bf5f4557309105dd7ff75518a32b99ed8f47fe1763e6794b39963bb39c1f6ec1ec96abda82d0a0c4569c71acc7722f443aad9860844e4dcd2f6b8d185c2d
7
- data.tar.gz: fecb62153ceb6e9d8770176009a2fe344371bb09ca21f26a53c41f82bc380befc8950be16d7559f1bbcdd39bb163bda55327ef93470551fa670eaea72235f4cb
6
+ metadata.gz: 4fbb96bf938b8547ad4e4374fa0267ca6a2d4fef55c471c21abc2186d89ac6851cbc3455cd3aea7373e761b5e01f377e97f310d3770ce2982dd537e9c745c941
7
+ data.tar.gz: 8fab044c5e6c59c6161e04c7a36602454999b03e4ecc743fc739740aea87d944a21824375a75f2d044e8c4074e1bd612ccf0a3e56fcf8863abf413806fd89b67
data/lib/dircrawl.rb CHANGED
@@ -2,12 +2,13 @@ require 'json'
2
2
  require 'pry'
3
3
 
4
4
  class DirCrawl
5
- def initialize(path, output_dir, ignore_includes, save, process_block, include_block, *args)
6
- @path = path
5
+ def initialize(path, output_dir, ignore_includes, save, process_block, include_block, extras_block, *args)
6
+ @path = path
7
7
  @output_dir = output_dir
8
8
  @ignore_includes = ignore_includes
9
9
  include_block.call
10
10
  @process_block = process_block
11
+ @extras_block = extras_block
11
12
  @output = Array.new
12
13
  @save = save
13
14
  crawl_dir(path, *args)
@@ -40,6 +41,14 @@ class DirCrawl
40
41
 
41
42
  # Process file
42
43
  elsif !file.include?(@ignore_includes)
44
+
45
+ # Create Dirs
46
+ create_write_dirs(dir.gsub(@path, @output_dir))
47
+
48
+ # Process Extras
49
+ extras = @extras_block.call(@output_dir+"/")
50
+
51
+ # Process Main
43
52
  processed = @process_block.call(dir+"/"+file, *args)
44
53
 
45
54
  # Only save in output if specified (to handle large dirs)
@@ -48,7 +57,6 @@ class DirCrawl
48
57
  end
49
58
 
50
59
  # Write to file
51
- create_write_dirs(dir.gsub(@path, @output_dir))
52
60
  File.write(get_write_dir(dir, file), processed)
53
61
  end
54
62
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dircrawl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. C. McGrath
8
+ - Brennan Novak
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []