Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add rake pipeline.

  • Loading branch information...
commit 9d0e077155ce3e963a8d73ce56acb3003e0fc7c4 1 parent 41ecbf2
@cmeiklejohn cmeiklejohn authored
View
61 Assetfile
@@ -0,0 +1,61 @@
+require 'rake-pipeline-web-filters'
+require 'uglifier'
+
+output 'public/javascripts'
+input 'assets/javascripts' do
+
+ match 'vendor/**/*.js' do
+ files = %w(
+ vendor/minispade.js
+ vendor/jquery.js
+ vendor/handlebars.js
+ vendor/ember.js
+ vendor/ember-data.js
+ )
+ concat files, 'vendor.js'
+ end
+
+ match '**/*.hbs' do
+ handlebars(
+ :key_name_proc => proc { |input|
+ input.path.sub(%r(^app/templates/), '').sub(/\.hbs$/, '')
+ }
+ )
+ concat 'app/templates.js'
+ end
+
+ match '{app,config,lib}/**/*.js' do
+ minispade(
+ string: true,
+ rewrite_requires: true,
+ module_id_generator: proc { |input|
+ input.path.sub(%r(^(app|config|lib)/), '').sub(/\.js$/, '')
+ }
+ )
+ concat 'application.js'
+ end
+end
+
+output 'public/stylesheets'
+input 'assets/javascripts/spec' do
+ match '**/*.css' do
+ copy 'spec.css'
+ end
+end
+input 'assets/stylesheets' do
+ match '**/*.css' do
+ files = %w(
+ vendor/bootstrap.css
+ )
+ concat files, 'application.css'
+ end
+end
+
+output 'public'
+input 'assets' do
+ match '*.erb' do
+ tilt do |input|
+ input.sub /\.erb$/, ''
+ end
+ end
+end
View
8 Gemfile
@@ -10,3 +10,11 @@ gem 'fog'
gem 'pg'
gem 'rake'
gem 'thin'
+
+group :assets do
+ gem 'rake-pipeline', github: 'livingsocial/rake-pipeline'
+ gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters'
+
+ gem 'uglifier'
+ gem 'tilt'
+end
View
27 Gemfile.lock
@@ -1,3 +1,19 @@
+GIT
+ remote: git://github.com/livingsocial/rake-pipeline.git
+ revision: 3465e0e3e134bf52ddf5d138e8c8262412080095
+ specs:
+ rake-pipeline (0.6.0)
+ rake (~> 0.9.0)
+ thor
+
+GIT
+ remote: git://github.com/wycats/rake-pipeline-web-filters.git
+ revision: e14e78ae70d0d25b1668c5273e80cd05a4ee52e6
+ specs:
+ rake-pipeline-web-filters (0.6.0)
+ rack
+ rake-pipeline (~> 0.6)
+
GEM
remote: http://rubygems.org/
specs:
@@ -19,6 +35,8 @@ GEM
daemons (1.1.9)
eventmachine (1.0.0)
excon (0.16.2)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
fog (1.5.0)
builder
excon (~> 0.14)
@@ -46,7 +64,12 @@ GEM
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
+ thor (0.16.0)
+ tilt (1.3.3)
tzinfo (0.3.33)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
webmachine (1.0.0)
i18n (>= 0.4.0)
multi_json
@@ -63,5 +86,9 @@ DEPENDENCIES
pg
rack
rake
+ rake-pipeline!
+ rake-pipeline-web-filters!
thin
+ tilt
+ uglifier
webmachine
View
8 Rakefile
@@ -0,0 +1,8 @@
+require 'bundler/setup'
+require 'rake-pipeline'
+
+namespace :assets do
+ task :precompile do
+ Rake::Pipeline::Project.new("Assetfile").invoke
+ end
+end
View
3  config.ru
@@ -6,6 +6,9 @@ Bundler.require
require 'giddyup'
require 'rack/static'
+require 'rake-pipeline'
+require 'rake-pipeline/middleware'
+use Rake::Pipeline::Middleware, "Assetfile"
use Rack::Static, :urls => ["/index.html", "/favicon.ico", "/css", "/js", "/images"], :root => "public"
run GiddyUp::Application.adapter
View
0  public/.gitkeep
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.