dirmangle 0.0.1 → 0.0.2

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/bin/dirmangle +1 -31
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e785caf27f388cd1f1bf8ed22afae13d55646a6
4
- data.tar.gz: 391573317c143d119ade15d0e9ee57e795ac8ff9
3
+ metadata.gz: f165dd9ecfb428952708886eddb01d20d884d778
4
+ data.tar.gz: f4aaadfdc67cbb635ef7208e13fc2eade90f2118
5
5
  SHA512:
6
- metadata.gz: d362686353e2d04b8493adad07a3cdd77306c79135d8beff514695d45a7819287f4341a11aa667451503484a6cda61d09b563a4733c6c6e754490d7c0673682e
7
- data.tar.gz: 7a635bd09cd365676fc5e2687cb14fb58e49dcfa3c1731d9f3a63a57e1542937979d86389b673a0048b846e6cf7ef95f1b47dd82e1388a59c18f169058baf78f
6
+ metadata.gz: e0fee6b084ffdf323559c300ba9e890273f80f638d9e2b2d8c4cc783c1445a93fddb4a6b3668f821040883eb7ce88a02c67768e63288024f0f4b4613cf7de895
7
+ data.tar.gz: cce0033ad3693ee8ceea357851e4cdbd8b2c7b3207f970fb0738ec1124df016c092beb951e09b6149d7957c110c8d295e874af915455412ac096076487dfff48
data/bin/dirmangle CHANGED
@@ -163,6 +163,7 @@ class Dirmangle
163
163
  destination = File.join(@destination_root, destination)
164
164
 
165
165
  # add this path translation rule to the processing stack
166
+ Dirmangle.log("Adding source #{source}", :debug)
166
167
  add_path(title, source, destination, config)
167
168
  end
168
169
  end
@@ -232,39 +233,8 @@ class Dirmangle
232
233
  next
233
234
  end
234
235
  end
235
-
236
- # prune empty directories from target
237
- prune_empty_directories(@destination_root)
238
- end
239
-
240
-
241
- def prune_empty_directories(root, options={})
242
- root = File.expand_path(root)
243
-
244
- # proc for removing an empty directory
245
- remover = Proc.new do |dir|
246
- if File.directory?(dir)
247
- if Dir.entries(dir).empty?
248
- Dirmangle.log("Pruning empty directory #{dir}", :debug)
249
- FileUtils.rmdir(dir, {
250
- :noop => @options[:noop]
251
- })
252
- end
253
- end
254
- end
255
-
256
- # remove all empty subdirectories
257
- Dir[File.join(root, '**', '*')].sort.reverse.each do |entry|
258
- remover.call(entry)
259
- end
260
-
261
- # remove an empty root directory (if specified)
262
- if options[:remove_root]
263
- remover.call(root)
264
- end
265
236
  end
266
237
 
267
-
268
238
  def add_path(rule, source, destination, options={})
269
239
  # push a new path pair to have some operation performed upon it
270
240
  if source && destination
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dirmangle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Hetzel