-
Notifications
You must be signed in to change notification settings - Fork 2
/
Assetfile
54 lines (43 loc) · 1.19 KB
/
Assetfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require "json"
require "rake-pipeline"
require "rake-pipeline-web-filters"
require "rake-pipeline-web-filters/helpers"
class HandlebarsFilter < Rake::Pipeline::Filter
def initialize(&block)
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') }
super(&block)
end
def generate_output(inputs, output)
inputs.each do |input|
name = File.basename(input.path, '.handlebars')
output.write "Ember.TEMPLATES['#{name}'] = Ember.Handlebars.compile(#{input.read.to_json});"
end
end
end
output "public/application"
input "ember-skeleton" do
match "templates/*.handlebars" do
filter HandlebarsFilter
concat "application.templates.js"
end
match 'controllers/*.js' do
concat 'application.controllers.js'
end
match 'models/*.js' do
concat 'application.models.js'
end
match 'index.js' do
concat 'application.app.js'
end
match "*.js" do
concat ["application.templates.js", "application.app.js", "application.models.js", "application.controllers.js"], "application.js"
end
# Stylesheets
match 'stylesheets/*.css' do
concat 'application.css'
end
match 'stylesheets/*.scss' do
sass
concat 'application.css'
end
end