Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
More stuff, no coherent comment
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Tyler Croy committed Feb 22, 2012
1 parent 7b4879e commit d169625
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 9 additions & 6 deletions app.rb
@@ -1,17 +1,15 @@
require 'rubygems'
require 'sinatra'
require 'haml'


set :root, File.dirname(__FILE__)
set :public_folder, File.dirname(__FILE__)
set :dump_errors, true
set :static, true
set :public_folder, File.dirname(__FILE__)

def development?
!(ENV['RACK_ENV'] == 'production')
end
get '/', :provides => 'html' do
haml :index
end

def javascript_files
files = []
Expand All @@ -24,11 +22,16 @@ def javascript_files
end


get '/', :provides => 'html' do
haml :index
end

if development?
set :logging, true
disable :protection

# Only enable the saving mechanism in test/development
put '/*' do
put '*' do
unless request.body.nil?
path = File.join(File.dirname(__FILE__), request.path)
puts ">> Commiting changes to #{path}"
Expand Down
10 changes: 9 additions & 1 deletion views/index.haml
Expand Up @@ -3,10 +3,18 @@
%title
Twi.st
%script{:type => "text/javascript", :src => "/amber/js/amber.js"}

- if development?
%script{:type => "text/javascript", :src => "/contrib/bootstrap/js/bootstrap.js"}
%link{:type => "text/css", :media => "screen", :href => "/contrib/bootstrap/css/bootstrap.css"}
- else
%script{:type => "text/javascript", :src => "/contrib/bootstrap/js/bootstrap.min.js"}
%link{:type => "text/css", :media => "screen", :href => "/contrib/bootstrap/css/bootstrap.min.css"}

%script{:type => "text/javascript"}
loadAmber({
files: [#{javascript_files}],
prefix: '../js/', /* For some reason Amber looks in the ./amber/ tree for our files */
prefix: '../js', /* For some reason Amber looks in the ./amber/ tree for our files */
ready: function() {
}});
%body
Expand Down

0 comments on commit d169625

Please sign in to comment.