Class: Registry::Uninstaller

Inherits:
Action show all
Defined in:
lib/radiant/extension/script.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Action

#rake

Constructor Details

#initialize(extension) ⇒ Uninstaller

Returns a new instance of Uninstaller.



64
65
66
# File 'lib/radiant/extension/script.rb', line 64

def initialize(extension)
  self.name = extension.name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



63
64
65
# File 'lib/radiant/extension/script.rb', line 63

def name
  @name
end

Instance Method Details

#migrate_downObject



73
74
75
# File 'lib/radiant/extension/script.rb', line 73

def migrate_down
  rake "radiant:extensions:#{name}:migrate VERSION=0"
end

#remove_extension_directoryObject



77
78
79
# File 'lib/radiant/extension/script.rb', line 77

def remove_extension_directory
  FileUtils.rm_r(File.join(RAILS_ROOT, 'vendor', 'extensions', name))
end

#uninstallObject



68
69
70
71
# File 'lib/radiant/extension/script.rb', line 68

def uninstall
  migrate_down
  remove_extension_directory
end