Created
November 13, 2012 08:58
-
-
Save Psvensso/4064733 to your computer and use it in GitHub Desktop.
Normal Gemfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'rake-pipeline-web-filters' | |
APPNAME = 'Digiex' | |
Encoding.default_external = Encoding::UTF_8 | |
Encoding.default_internal = Encoding::UTF_8 | |
WebFilters = Rake::Pipeline::Web::Filters | |
class HandlebarsFilter < Rake::Pipeline::Filter | |
def initialize(&block) | |
block ||= proc { |input| input.sub(/\.html$/, '.js') } | |
super(&block) | |
end | |
def generate_output(inputs, output) | |
inputs.each do |input| | |
output.write "return Ember.Handlebars.compile(#{input.read.to_json})" | |
end | |
end | |
end | |
output "public" | |
input "" do | |
match "Edge/**/*.html" do | |
filter HandlebarsFilter | |
filter Rake::Pipeline::Web::Filters::MinispadeFilter, | |
:module_id_generator => proc { |input| File.basename(input.fullpath, ".js") + "_template" } | |
filter Rake::Pipeline::ConcatFilter, "EdgeTemplates.js" | |
#uglify {|input| input} | |
end | |
match 'Edge/**/*.js' do | |
# uglify {|input| input} | |
minispade :rewrite_requires => true, | |
:string=> true, | |
:module_id_generator => proc { |input| | |
input.path.sub(/^lib\//, "#{APPNAME}/").sub(/\.js$/, '') | |
} | |
concat 'Edge.js' | |
end | |
match 'Edge/**/*.html' do | |
minispade :rewrite_requires => true, | |
:string=> true, | |
:module_id_generator => proc { |input| | |
input.path.sub(/^lib\//, "#{APPNAME}/").sub(/\.js$/, '') | |
} | |
concat 'Edge.js' | |
end | |
match 'Common/**/*.js' do | |
# uglify {|input| input} | |
minispade :rewrite_requires => true, | |
:string=> true, | |
:module_id_generator => proc { |input| | |
input.path.sub(/^lib\//, "#{APPNAME}/").sub(/\.js$/, '') | |
} | |
concat 'Edge.js' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org/" | |
gem 'colored' | |
gem 'guard' | |
gem 'guard-rake' | |
gem 'wdm', :require => false | |
#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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'rake', :task => 'buildInternal' do | |
watch(%r{^Internal/.+\$}) | |
end | |
guard 'rake', :task => 'buildEdge' do | |
watch(%r{^Edge/.+\.js$}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPNAME = 'MyApp' | |
require 'colored' | |
require 'rake-pipeline' | |
desc "Build #{APPNAME} Edge" | |
task :buildEdge do | |
Rake::Pipeline::Project.new('EdgeAssetfile').invoke | |
end | |
desc "Build #{APPNAME} Edge Templates" | |
task :buildEdgeTemplates do | |
Rake::Pipeline::Project.new('EdgeTemplatesAssetfile').invoke | |
end | |
desc "Build #{APPNAME} Internal" | |
task :buildInternal do | |
Rake::Pipeline::Project.new('InternalAssetfile').invoke | |
end | |
desc "Build #{APPNAME} Internal Templates" | |
task :buildInternalTemplates do | |
Rake::Pipeline::Project.new('InternalTemplatesAssetfile').invoke | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment