class EY::Serverside::RailsAssets::Strategy::Shared

Basic shared assets. Precompiled assets go into a single shared assets directory. The assets directory is never cleaned, so a deploy hook should be used to clean assets appropriately.

When no assets changes are detected, shared directory is only symlinked and precompile task is not run.

Attributes

paths[R]
runner[R]

Public Class Methods

new(paths, runner) click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 87
def initialize(paths, runner)
  @paths = paths
  @runner = runner
end

Public Instance Methods

prepare() { || ... } click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 100
def prepare
  reuse
  yield
end
reusable?() click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 92
def reusable?
  shared_assets_path.directory? && shared_assets_path.entries.any?
end
reuse() click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 96
def reuse
  run "mkdir -p #{shared_assets_path} && ln -nfs #{shared_assets_path} #{paths.public}"
end

Protected Instance Methods

run(cmd) click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 107
def run(cmd)
  runner.run(cmd)
end
shared_assets_path() click to toggle source
# File lib/engineyard-serverside/rails_assets/strategy.rb, line 111
def shared_assets_path
  paths.shared_assets
end