github.com/outbrain/consul@v1.4.5/ui/scripts/compile.rb (about)

     1  require 'uglifier'
     2  
     3  File.open("static/application.min.js", "w") {|file| file.truncate(0) }
     4  
     5  libs = [
     6    "javascripts/libs/jquery-1.10.2.min.js",
     7    "javascripts/libs/handlebars-1.3.0.min.js",
     8    "javascripts/libs/ember.min.js",
     9    "javascripts/libs/base64.min.js",
    10    "javascripts/libs/ember-validations.min.js",
    11    "javascripts/libs/list-view.min.js",
    12    "javascripts/libs/classie.js",
    13    "javascripts/libs/notificationFx.js",
    14  ]
    15  
    16  app = [
    17    "javascripts/app/router.js",
    18    "javascripts/app/models.js",
    19    "javascripts/app/routes.js",
    20    "javascripts/app/controllers.js",
    21    "javascripts/app/views.js",
    22    "javascripts/app/helpers.js",
    23  ]
    24  
    25  libs.each do |js_file|
    26    File.open("static/application.min.js", "a") do |f|
    27      puts "cat #{js_file}"
    28      f << File.read(js_file)
    29    end
    30  end
    31  
    32  app.each do |js_file|
    33    File.open("static/application.min.js", "a") do |f|
    34      puts "compile #{js_file}"
    35      f << Uglifier.compile(File.read(js_file))
    36    end
    37  end