Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 40431347195e179ef82020e11bde602939026d65 Devin Torres committed Feb 2, 2012
@@ -0,0 +1,3 @@
+.DS_Store
+tmp/
+assets/
106 Assetfile
@@ -0,0 +1,106 @@
+APPNAME = 'ember-skeleton'
+
+require 'json'
+require 'rake-pipeline-web-filters'
+
+WebFilters = Rake::Pipeline::Web::Filters
+
+class LoaderFilter < WebFilters::MinispadeFilter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ code = input.read
+ module_id = @module_id_generator.call(input)
+ contents = "function(require) {\n#{code}\n}"
+ ret = "\nloader.register('#{module_id}', #{contents});\n"
+ output.write ret
+ end
+ end
+end
+
+class EmberAssertFilter < Filter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ result = input.read
+ result.gsub!(/ember_assert\((.*)\);/, '')
+ output.write(result)
+ end
+ end
+end
+
+class HandlebarsFilter < Filter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ code = input.read.to_json
+ name = File.basename(input.path, '.handlebars')
+ output.write "\nreturn Ember.Handlebars.compile(#{code});\n"
+ end
+ end
+end
+
+input 'app'
+output 'assets'
+
+match 'lib/**/*.js' do
+ filter LoaderFilter,
+ :module_id_generator => proc { |input|
+ input.path.sub(/^lib\//, "#{APPNAME}/").sub(/\.js$/, '')
+ }
+
+ if ENV['RAKEP_MODE'] == 'production'
+ filter EmberAssertFilter
+ uglify
+ end
+ concat 'app.js'
+end
+
+match 'vendor/**/*.js' do
+ filter LoaderFilter,
+ :module_id_generator => proc { |input|
+ input.path.sub(/^vendor\//, '').sub(/\.js$/, '')
+ }
+
+ if ENV['RAKEP_MODE'] == 'production'
+ filter EmberAssertFilter
+ uglify
+ end
+ concat %w[
+ vendor/jquery.js
+ vendor/ember.js
+ vendor/sproutcore-routing.js
+ ], 'app.js'
+end
+
+match 'templates/**/*.handlebars' do
+ filter HandlebarsFilter
+ filter LoaderFilter,
+ :module_id_generator => proc { |input|
+ input.path.sub(/^templates\//, "#{APPNAME}/~templates/").sub(/\.handlebars$/, '')
+ }
+ if ENV['RAKEP_MODE'] == 'production'
+ uglify
+ end
+ concat 'app.js'
+end
+
+match 'css/**/*.css' do
+ if ENV['RAKEP_MODE'] == 'production'
+ yui_css
+ end
+ concat ['bootstrap.css', 'main.css'], 'app.css'
+end
+
+match 'css/**/*.scss' do
+ sass
+ if ENV['RAKEP_MODE'] == 'production'
+ yui_css
+ end
+ concat 'app.css'
+end
+
+match "static/**/*" do
+ concat do |input|
+ input.sub(/static\//, '')
+ end
+end
+
+# vim: filetype=ruby
13 Gemfile
@@ -0,0 +1,13 @@
+source "http://rubygems.org"
+
+gem "rack"
+gem "rack-rewrite"
+
+gem "sass"
+gem "compass"
+
+gem "uglifier"
+gem "yui-compressor"
+
+gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git"
+gem "rake-pipeline-web-filters", :git => "https://github.com/wycats/rake-pipeline-web-filters.git"
@@ -0,0 +1,56 @@
+GIT
+ remote: https://github.com/livingsocial/rake-pipeline.git
+ revision: 56bbc5d9cf7ce1b69d29d3d6af7282603dcdebba
+ specs:
+ rake-pipeline (0.5.0)
+ rake (~> 0.9.0)
+ thor
+
+GIT
+ remote: https://github.com/wycats/rake-pipeline-web-filters.git
+ revision: 32428ba45bbc74e02287a7cf483004df71d89533
+ specs:
+ rake-pipeline-web-filters (0.5.0)
+ rack
+ rake-pipeline
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ POpen4 (0.1.4)
+ Platform (>= 0.4.0)
+ open4
+ Platform (0.4.0)
+ chunky_png (1.2.5)
+ compass (0.11.7)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ fssm (0.2.8.1)
+ multi_json (1.0.4)
+ open4 (1.3.0)
+ rack (1.4.1)
+ rack-rewrite (1.2.1)
+ rake (0.9.2.2)
+ sass (3.1.12)
+ thor (0.14.6)
+ uglifier (1.2.2)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+ yui-compressor (0.9.6)
+ POpen4 (>= 0.1.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ compass
+ rack
+ rack-rewrite
+ rake-pipeline!
+ rake-pipeline-web-filters!
+ sass
+ uglifier
+ yui-compressor
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2011 Interline Vacations, Inc.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,10 @@
+Ember Skeleton
+==============
+
+A skeleton application framework using Ember.js and Rake Pipeline.
+
+Running
+-------
+
+ $ bundle install
+ $ bundle exec rackup
Oops, something went wrong.

0 comments on commit 4043134

Please sign in to comment.