160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
# File 'lib/snails/app.rb', line 160
def self.precompile_for(app)
unless app.respond_to?(:assets_public_path)
return puts "#{app.name} doesn't have the Asset module included."
end
puts "Precompiling #{app.name} assets to #{app.assets_public_path}..."
FileUtils.remove_dir(app.assets_public_path.to_s, true)
environment = app.sprockets
manifest = ::Sprockets::Manifest.new(environment.index, app.assets_public_path)
manifest.compile(app.assets_precompile)
if app.assets_remove_digests?
files = `find #{app.assets_public_path}`.split("\n").select { |f| f[/\.(js|css)/] }
remove_digests(files)
end
end
|