Class: Capricorn::Actors::BaseActor
- Inherits:
-
Capricorn::Actor
- Object
- Capricorn::Actor
- Capricorn::Actors::BaseActor
- Defined in:
- lib/capricorn/actors/base_actor.rb
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Capricorn::Actor
Instance Method Summary collapse
-
#create_rails_app ⇒ Object
create a new rails app for the current satellite.
-
#destroy_rails_app ⇒ Object
destroy the rails app for the current satellite.
-
#link_engines ⇒ Object
link the required engines for the current satellite.
Methods inherited from Capricorn::Actor
Methods included from Capricorn::Actor::Actions
included, #run_callbacks!, #run_callbacks_in_fase!
Constructor Details
This class inherits a constructor from Capricorn::Actor
Instance Method Details
#create_rails_app ⇒ Object
create a new rails app for the current satellite
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/capricorn/actors/base_actor.rb', line 11 def create_rails_app system.as_user(system.web_user, system.web_group) do FileUtils.mkdir_p(File.dirname(system.satellite_root), :verbose => true) FileUtils.mkdir_p(system.shared_root, :verbose => true) end Dir.chdir(File.dirname(system.satellite_root)) do system.user_run system.web_user, "rails --force #{system.satellite_root}" end system.as_user(system.web_user, system.web_group) do Dir.chdir(File.dirname(system.satellite_root)) do link(File.join(system.shared_root, 'public'), File.join(system.satellite_root, 'public', 'system')) link(File.join(system.shared_root, 'private'), File.join(system.satellite_root, 'db', 'system')) link(File.join(system.shared_root, 'log'), File.join(system.satellite_root, 'log')) link(File.join(system.shared_root, 'settings'), File.join(system.satellite_root, 'config', 'settings')) end end end |
#destroy_rails_app ⇒ Object
destroy the rails app for the current satellite
37 38 39 |
# File 'lib/capricorn/actors/base_actor.rb', line 37 def destroy_rails_app FileUtils.rm_rf system.satellite_root, :verbose => true end |
#link_engines ⇒ Object
link the required engines for the current satellite
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/capricorn/actors/base_actor.rb', line 42 def link_engines Dir.chdir(system.satellite_root) do system.as_user(system.web_user, system.web_group) do write_environment clean_links @dependecies.reverse_each do |spec| link_engine(spec) end end run_migrations end end |