Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (32 sloc) 1.002 kb
class Fancy Package {
class Uninstaller : Handler {
"""
@Fancy::Package@ Uninstaller.
"""
def initialize: @package_name {
super initialize: @package_name
}
def run {
load_fancypack: |spec| {
Specification delete_specification: spec from: $ Fancy Package package_list_file
delete_package_dir
delete_lib_file: (spec package_name)
"Successfully uninstalled package #{spec package_name} with version: #{spec version}." println
} else: {
System abort: "No package found for #{@package_name} with version '#{@version}'."
}
}
def delete_package_dir {
require("FileUtils")
if: (Directory exists?: installed_path) then: {
"Deleting directory: #{installed_path}" println
FileUtils rm_rf(installed_path)
}
}
def delete_lib_file: package_name {
lib_file = "#{lib_path}/#{package_name}"
"Deleting: #{lib_file}" println
File delete: lib_file
}
}
}
Jump to Line
Something went wrong with that request. Please try again.