Permalink
Browse files

Simplify.

  • Loading branch information...
1 parent e9c83e9 commit aaa434af70cf127be08d8b42d019a1aedace9cb1 tim committed Jul 10, 2003
Showing with 5 additions and 4 deletions.
  1. +5 −4 post-clean.rb
View
@@ -3,10 +3,11 @@
# doc/ex/* (!rb)
require 'ftools'
-targets = Dir['doc/*.rb.html']
+Dir.chdir('doc')
+targets = Dir['*.rb.html']
File.safe_unlink(*targets) unless targets.empty?
-targets = Dir['doc/ex/*']
-targets.delete_if { |entry| !File.file?(entry) || %r{\.rb\z}.match(entry) }
+Dir.chdir('ex')
+targets = Dir['*']
+targets.delete_if { |entry| File.directory?(entry) || %r{\.rb\z}.match(entry) }
File.safe_unlink(*targets) unless targets.empty?
-

0 comments on commit aaa434a

Please sign in to comment.