Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember #1

Merged
merged 1 commit into from Mar 29, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 61 additions & 0 deletions src/ember-client/Assetfile
@@ -0,0 +1,61 @@
require "json"
require "rake-pipeline"
require "rake-pipeline-web-filters"
require "rake-pipeline-web-filters/helpers"

# processed files should be outputted to public
output "."

input "less" do
match "bootstrap.less" do
less :paths => ['less'], :filename => 'bootstrap.less'
concat "auth.css"
end

match "**/*.css" do
yui_css
end
end

#input "vendor" do
# match "*.js" do
# concat "js/vendor-plugins.js"
# end

# match "**/*.js" do
# uglify
# end
#end

input "web-packages" do
# process all coffee files
match "**/*.coffee" do
coffee_script
end

# process handlebars files
match "*/templates/*.handlebars" do
handlebars
end

match "*/{lib,templates}/**/*.js" do
minispade :rewrite_requires => true, :string => true, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
id
}

concat "js/2.js"
end

match "minispade.js" do
concat "js/1.js"
end

match "js/*.js" do
concat "auth.js"
end
end
# vim: filetype=ruby
12 changes: 12 additions & 0 deletions src/ember-client/Gemfile
@@ -0,0 +1,12 @@
# A sample Gemfile
source "https://rubygems.org"

gem "uglifier", "~> 1.0.3"
gem "execjs", "~> 1.2.6"
gem "rack"
gem "less"
gem "yui-compressor"
gem "coffee-script"
gem "rack-streaming-proxy"
gem 'rake-pipeline', :git => 'git://github.com/livingsocial/rake-pipeline.git'
gem 'rake-pipeline-web-filters', :git => 'git://github.com/wycats/rake-pipeline-web-filters.git'
65 changes: 65 additions & 0 deletions src/ember-client/Gemfile.lock
@@ -0,0 +1,65 @@
GIT
remote: git://github.com/livingsocial/rake-pipeline.git
revision: f71caeb1406dafd6af5ab8453db8c5ac53947c92
specs:
rake-pipeline (0.6.0)
rake (~> 0.9.0)
thor

GIT
remote: git://github.com/wycats/rake-pipeline-web-filters.git
revision: fe752a8cfdbb318b746fd76fd3c10dd8b8f29891
specs:
rake-pipeline-web-filters (0.6.0)
rack
rake-pipeline (~> 0.6)

GEM
remote: https://rubygems.org/
specs:
POpen4 (0.1.4)
Platform (>= 0.4.0)
open4
Platform (0.4.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
commonjs (0.2.0)
therubyracer (~> 0.9.9)
execjs (1.2.13)
multi_json (~> 1.0)
less (2.0.9)
commonjs (~> 0.2.0)
therubyracer (~> 0.9.9)
libv8 (3.3.10.4)
multi_json (1.0.4)
open4 (1.3.0)
rack (1.4.1)
rack-streaming-proxy (1.0.3)
rack (>= 1.0)
servolux (~> 0.8.1)
rake (0.9.2.2)
servolux (0.8.1)
therubyracer (0.9.9)
libv8 (~> 3.3.10)
thor (0.14.6)
uglifier (1.0.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
yui-compressor (0.9.6)
POpen4 (>= 0.1.4)

PLATFORMS
ruby

DEPENDENCIES
coffee-script
execjs (~> 1.2.6)
less
rack
rack-streaming-proxy
rake-pipeline!
rake-pipeline-web-filters!
uglifier (~> 1.0.3)
yui-compressor
26 changes: 26 additions & 0 deletions src/ember-client/config.ru
@@ -0,0 +1,26 @@
require 'bundler/setup'
require 'rake-pipeline'
require 'rake-pipeline/middleware'
require "rack/streaming_proxy" # Don't forget to install the rack-streaming-proxy gem.

class NoCache
def initialize(app)
@app = app
end

def call(env)
@app.call(env).tap do |status, header, body|
headers["Cache-Control"] = "no-store"
end
end
end

use Rack::StreamingProxy do |request|
# Insert your own logic here
if request.path.start_with?("/bclegal")
"http://localhost:1337#{request.path}"
end
end

use Rake::Pipeline::Middleware, 'Assetfile' # This is the path to your Assetfile
run Rack::Directory.new('.') # This should match whatever your Assetfile's output directory is