File: post-clean.rb

package info (click to toggle)
ruby-rmagick 2.13.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,620 kB
  • ctags: 1,785
  • sloc: ansic: 16,759; ruby: 9,717; makefile: 14; sh: 14
file content (12 lines) | stat: -rw-r--r-- 383 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
# delete RMagick documentation created by post-setup.rb
# doc/*.rb.html
# doc/ex/* (!rb)
# Bug #246: Don't use chdir!
require 'fileutils'

targets = Dir['doc/*.rb.html']
FileUtils.safe_unlink(targets) unless targets.empty?

targets = Dir['doc/ex/*']
targets.delete_if { |entry| File.directory?(entry) || %r{\.rb\z}.match(entry) }
FileUtils.safe_unlink(targets) unless targets.empty?