travis-web/AssetFile
Piotr Sarnacki c05ce673bf Load incomplete records when trying to get unknown attribute
In order to minimize ajax requests, I implemented isComplete property,
which can be used to check if record is fetched from the API or if it
was just partially loaded (for example by pusher event). This is nice in
terms of requests reduction, but caries risk of showing incomplete data.

This commit fixes this situation by saving which attributes were
provided on "incomplete" load and triggering refresh when any unknown
attribute is tried to be fetched.

The implementation is really simple and will probably need refactoring,
but I would like to test it in the wild before putting much more time
into it.
2012-10-16 03:05:38 +02:00

82 lines
1.5 KiB
Plaintext

$: << 'lib'
require 'rake-pipeline-web-filters'
require 'travis/assets'
require 'compass'
assets ||= Travis::Assets.new
assets.setup_compass
assets.update_version
output 'public/scripts'
input assets.scripts do
match '**/*.hbs' do
travis_handlebars :precompile => assets.production?
concat 'templates.js'
end
match '**/*.coffee' do
coffee_script
end
match 'vendor/**/*.js' do
safe_concat assets.vendor_order, 'vendor.js'
end
match '{spec,spec/unit}/*.js' do
concat 'spec/specs.js'
end
match 'spec/support/*.js' do
concat 'spec/support.js'
end
match 'spec/vendor/*.js' do
concat assets.spec_vendor_order, 'spec/vendor.js'
end
match 'spec/{vendor,support,specs}.js' do
concat ['spec/vendor.js', 'spec/support.js', 'spec/specs.js'], 'specs.js'
end
match %r(^(?!vendor|spec).*\.js$) do
modules = proc { |input| input.path.gsub(%r((^app/|lib/|\.js$)), '') }
minispade(string: assets.development?, rewrite_requires: true, module_id_generator: modules)
end
match %r(^(?!spec).*\.js$) do
concat ['vendor.js'], ['app.js', 'min/app.js']
end
if assets.production?
match 'min/app.js' do
strip_debug
uglify squeeze: true
concat 'app.min.js'
end
end
end
output 'public/styles'
input assets.styles do
match '**/*.{scss,sass}' do
sass
concat [], 'app.css'
end
end
output 'public/images'
input assets.images do
skip %r(^ui/)
match '**/*' do
copy
end
end
# output 'public'
# input assets.static do
# match '**/*' do
# copy
# end
# end