Class: Beyond::Plugin
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Beyond::Plugin
- Defined in:
- app/models/beyond/plugin.rb
Instance Method Summary collapse
Instance Method Details
#extract ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/models/beyond/plugin.rb', line 14 def extract Dir.chdir File.join(ENV['tenants_plugins_dir'], tenant.name) do unless Kernel.system "tar xzf #{archive_file_name}" throw "Can't extract archive" end end end |
#start ⇒ Object
29 30 31 32 |
# File 'app/models/beyond/plugin.rb', line 29 def start extract update_attribute(:activated, true) end |
#stop ⇒ Object
22 23 24 25 26 27 |
# File 'app/models/beyond/plugin.rb', line 22 def stop Dir.chdir File.join(ENV['tenants_plugins_dir'], tenant.name) do FileUtils.rm_r(name) end update_attribute(:activated, false) end |