Class: Registry::Uninstaller

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Action

#file_utils, #rake, #tasks_include?

Constructor Details

#initialize(extension) ⇒ Uninstaller

Returns a new instance of Uninstaller.



87
88
89
# File 'lib/radiant/extension/script.rb', line 87

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



86
87
88
# File 'lib/radiant/extension/script.rb', line 86

def name
  @name
end

Instance Method Details

#migrate_downObject



96
97
98
# File 'lib/radiant/extension/script.rb', line 96

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

#remove_extension_directoryObject



100
101
102
# File 'lib/radiant/extension/script.rb', line 100

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

#uninstallObject



91
92
93
94
# File 'lib/radiant/extension/script.rb', line 91

def uninstall
  migrate_down
  remove_extension_directory
end