Permalink
Browse files

Remove Ruby 1.6-isms

  • Loading branch information...
1 parent cbd3425 commit 7e7b3fe61aecfd4dee03fbac43ace414a2b36780 rmagick committed Jan 1, 2008
Showing with 6 additions and 6 deletions.
  1. +6 −6 uninstall.rb
View
@@ -1,6 +1,6 @@
# uninstall RMagick - called from Makefile uninstall target
-require 'ftools'
+require 'fileutils'
class Dir
def Dir.safe_unlink(dir)
@@ -23,7 +23,7 @@ def rmdir(dir, no_check=false)
targets = Dir[dir+'/*']
targets += Dir[dir+'/.*'].delete_if { |f| FileTest.directory?(f) }
if not targets.empty?
- File.safe_unlink(*targets)
+ FileUtils.safe_unlink(targets)
end
Dir.safe_unlink(dir)
end
@@ -56,13 +56,13 @@ def rmdir(dir, no_check=false)
arch = ::Config::CONFIG['arch']
prefix ||= ::Config::CONFIG['prefix']
-site_ruby ||= File.join(prefix, 'lib', 'ruby', 'site_ruby', version)
-so_dir ||= File.join(prefix, 'lib', 'ruby', 'site_ruby', version, arch)
+site_ruby ||= ::Config::CONFIG['sitelibdir']
+so_dir ||= ::Config::CONFIG['sitearchdir']
doc_dir ||= File.join(prefix, 'share', 'RMagick')
dlext = ::Config::CONFIG['DLEXT']
-File.safe_unlink File.join(site_ruby, 'RMagick.rb'), true
-File.safe_unlink File.join(so_dir, 'RMagick.' + dlext), true
+FileUtils.safe_unlink File.join(site_ruby, 'RMagick.rb'), true
+FileUtils.safe_unlink File.join(so_dir, 'RMagick.' + dlext), true
rmdir File.join(site_ruby, 'rvg'), true
rmdir File.join(doc_dir, 'ex', 'images')

0 comments on commit 7e7b3fe

Please sign in to comment.