Class: EY::Serverside::RailsAssets::Strategy::Shifting
- Defined in:
- lib/engineyard-serverside/rails_assets/strategy.rb
Overview
The default behavior and the one used since the beginning of asset support in engineyard-serverside. Assets are compiled into a fresh shared directory. Previous shared assets are shifted to a last_assets directory to prevent errors during deploy.
When no assets changes are detected, the two shared directories are symlinked into the active release without any changes.
Instance Attribute Summary
Attributes inherited from Shared
Instance Method Summary collapse
- #prepare ⇒ Object
-
#reuse ⇒ Object
link shared/assets and shared/last_assets into public.
Methods inherited from Shared
Constructor Details
This class inherits a constructor from EY::Serverside::RailsAssets::Strategy::Shared
Instance Method Details
#prepare ⇒ Object
175 176 177 178 179 180 181 |
# File 'lib/engineyard-serverside/rails_assets/strategy.rb', line 175 def prepare shift_existing_assets yield rescue unshift_existing_assets raise end |
#reuse ⇒ Object
link shared/assets and shared/last_assets into public
171 172 173 |
# File 'lib/engineyard-serverside/rails_assets/strategy.rb', line 171 def reuse run "mkdir -p #{shared_assets_path} #{last_assets_path} && #{link_assets}" end |