Class: Registry::Installer
- Defined in:
- lib/radiant/extension/script.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #copy_to_vendor_extensions ⇒ Object
-
#initialize(url, name) ⇒ Installer
constructor
A new instance of Installer.
- #install ⇒ Object
- #migrate ⇒ Object
- #update ⇒ Object
Methods inherited from Action
Constructor Details
#initialize(url, name) ⇒ Installer
Returns a new instance of Installer.
38 39 40 |
# File 'lib/radiant/extension/script.rb', line 38 def initialize(url, name) self.url, self.name = url, name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
37 38 39 |
# File 'lib/radiant/extension/script.rb', line 37 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
37 38 39 |
# File 'lib/radiant/extension/script.rb', line 37 def path @path end |
#url ⇒ Object
Returns the value of attribute url.
37 38 39 |
# File 'lib/radiant/extension/script.rb', line 37 def url @url end |
Instance Method Details
#copy_to_vendor_extensions ⇒ Object
48 49 50 51 |
# File 'lib/radiant/extension/script.rb', line 48 def copy_to_vendor_extensions FileUtils.cp_r(self.path, File.(File.join(RAILS_ROOT, 'vendor', 'extensions', name))) FileUtils.rm_r(self.path) end |
#install ⇒ Object
42 43 44 45 46 |
# File 'lib/radiant/extension/script.rb', line 42 def install copy_to_vendor_extensions migrate update end |
#migrate ⇒ Object
53 54 55 |
# File 'lib/radiant/extension/script.rb', line 53 def migrate rake "radiant:extensions:#{name}:migrate" end |
#update ⇒ Object
57 58 59 |
# File 'lib/radiant/extension/script.rb', line 57 def update rake "radiant:extensions:#{name}:update" end |