Permalink
Browse files

coffeescript serving

  • Loading branch information...
1 parent 8975a39 commit bf2cebc24e15f433d9a04f8b49941361eff9590d @geelen committed Jun 4, 2012
Showing with 16 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +8 −0 Gemfile.lock
  3. +6 −0 app.rb
  4. 0 application.coffee
  5. +1 −0 index.haml
View
@@ -3,3 +3,4 @@ gem 'thin'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'haml'
+gem 'coffee-script'
View
@@ -2,9 +2,16 @@ GEM
remote: http://rubygems.org/
specs:
backports (2.6.1)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
daemons (1.1.8)
eventmachine (0.12.10)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
haml (3.1.4)
+ multi_json (1.2.0)
rack (1.4.1)
rack-protection (1.2.0)
rack
@@ -31,6 +38,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ coffee-script
haml
sinatra
sinatra-contrib
View
6 app.rb
@@ -1,9 +1,15 @@
require 'sinatra'
require 'sinatra/reloader' if development?
+require 'coffee-script'
+require 'haml'
set :haml, format: :html5
set :views, '.'
get '/' do
haml :index
end
+
+get '/application.js' do
+ coffee :application
+end
View
No changes.
View
@@ -2,5 +2,6 @@
%html
%head
%script(src='http://code.angularjs.org/angular-1.0.0rc10.min.js')
+ %script(src='/application.js')
%body(ng-app)
%h1 {{ 1 + 2 }}

0 comments on commit bf2cebc

Please sign in to comment.