right_data 0.5.14 → 0.5.15

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. data/lib/FileSystemItem.rb +1 -0
  2. data/lib/main.rb +11 -1
  3. metadata +3 -3
@@ -25,6 +25,7 @@ module RightData
25
25
  self
26
26
  end
27
27
 
28
+ # TODO: Do this for LEAVES instead of files. Include empty dirs.
28
29
  def files
29
30
  return 0 if leaf? && File.directory?(fullPath)
30
31
  return 1 if leaf?
data/lib/main.rb CHANGED
@@ -209,7 +209,17 @@ module RightData
209
209
  tree = FileSystemItem.new(prune, :parent => nil)
210
210
  # Mark the nodes:
211
211
  tree.traverse do |n|
212
- next true if File.directory?(n.path)
212
+ # Could keep track of empty dirs too...
213
+ if File.directory?(n.path)
214
+ # If empty dir...
215
+ if n.leaf?
216
+ n.ignorable = true
217
+ n.parent.increment_ignorable_children
218
+ next false # Don't bother, no kids
219
+ else
220
+ next true
221
+ end
222
+ end
213
223
  count += 1
214
224
  if ignore_test(n.path)
215
225
  n.ignorable = true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_data
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 14
10
- version: 0.5.14
9
+ - 15
10
+ version: 0.5.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonathan Siegel