Skip to content

Commit

Permalink
converted most js files to coffee files. added the coffeescript filte…
Browse files Browse the repository at this point in the history
…r to the rake asset pipeline. made it so scss files that begin with _ (underscore) will not be run through sass compiler. so you would import those files in a sass file that doesn't start with _
  • Loading branch information
ynnadrules committed Sep 6, 2012
1 parent 0d99398 commit a23c270
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 44 deletions.
27 changes: 26 additions & 1 deletion Assetfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
APPNAME = 'ember-skeleton'

require 'json'
require 'coffee-script'
require 'rake-pipeline-web-filters'

WebFilters = Rake::Pipeline::Web::Filters
Expand All @@ -27,6 +28,14 @@ class EmberAssertFilter < Filter
end
end

class HamlbarsFilter < Filter
def generate_output(inputs, output)
inputs.each do |input|

end
end
end

class HandlebarsFilter < Filter
def generate_output(inputs, output)
inputs.each do |input|
Expand All @@ -39,6 +48,10 @@ end
output 'assets'

input 'app' do
match '**/*.coffee' do
filter WebFilters::CoffeeScriptFilter
end

match 'lib/**/*.js' do
filter LoaderFilter,
:module_id_generator => proc { |input|
Expand Down Expand Up @@ -113,7 +126,13 @@ input 'app' do
concat ['bootstrap.css', 'main.css'], 'app.css'
end

match 'css/**/*.scss' do
# ignore scss files that start with _
# usually scss files that begin with _
# are imported in some specific order
# which is why I did this instead of
# just letting these scss files get
# compiled in the order they're encountered
match( /^css\/(.*\/)*[^_]*.scss$/ ) do
sass
if ENV['RAKEP_MODE'] == 'production'
yui_css
Expand All @@ -128,4 +147,10 @@ input 'app' do
end
end

input 'tests' do
match '**/*.coffee' do
filter WebFilters::CoffeeScriptFilter
end
end

# vim: filetype=ruby
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gem 'rack-rewrite'

gem 'sass'
gem 'compass'
gem 'coffee-script'

gem 'uglifier'
gem 'yui-compressor'
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ GEM
open4
Platform (0.4.0)
chunky_png (1.2.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.3)
colored (1.2)
compass (0.12.2)
chunky_png (~> 1.2)
Expand Down Expand Up @@ -63,6 +67,7 @@ PLATFORMS
ruby

DEPENDENCIES
coffee-script
colored
compass
guard
Expand Down
1 change: 0 additions & 1 deletion app/lib/controllers.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/lib/controllers/application.js

This file was deleted.

10 changes: 0 additions & 10 deletions app/lib/core.js

This file was deleted.

7 changes: 0 additions & 7 deletions app/lib/main.js

This file was deleted.

11 changes: 0 additions & 11 deletions app/lib/router.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/lib/store.js

This file was deleted.

1 change: 0 additions & 1 deletion app/lib/views.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/lib/views/application.js

This file was deleted.

1 change: 1 addition & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'rake-pipeline'
require 'rake-pipeline/middleware'

use Rake::Pipeline::Middleware, 'Assetfile'

# require 'rack/streaming_proxy'
Expand Down

0 comments on commit a23c270

Please sign in to comment.