consul/ui/scripts/compile.rb

38 lines
927 B
Ruby
Raw Normal View History

2014-05-01 15:21:55 +00:00
require 'uglifier'
File.open("static/application.min.js", "w") {|file| file.truncate(0) }
libs = [
2014-05-02 18:08:47 +00:00
"javascripts/libs/jquery-1.10.2.min.js",
"javascripts/libs/handlebars-1.3.0.min.js",
"javascripts/libs/ember.min.js",
2015-07-23 07:56:23 +00:00
"javascripts/libs/base64.min.js",
2014-05-02 18:08:47 +00:00
"javascripts/libs/ember-validations.min.js",
2014-06-04 19:42:59 +00:00
"javascripts/libs/list-view.min.js",
2014-08-22 23:03:46 +00:00
"javascripts/libs/classie.js",
"javascripts/libs/notificationFx.js",
2014-05-01 15:21:55 +00:00
]
app = [
"javascripts/app/router.js",
"javascripts/app/models.js",
"javascripts/app/routes.js",
"javascripts/app/controllers.js",
"javascripts/app/views.js",
2014-05-01 17:15:33 +00:00
"javascripts/app/helpers.js",
2014-05-01 15:21:55 +00:00
]
libs.each do |js_file|
File.open("static/application.min.js", "a") do |f|
2014-05-02 18:08:47 +00:00
puts "cat #{js_file}"
f << File.read(js_file)
2014-05-01 15:21:55 +00:00
end
end
app.each do |js_file|
File.open("static/application.min.js", "a") do |f|
puts "compile #{js_file}"
f << Uglifier.compile(File.read(js_file))
end
end