Permalink
Browse files

working, thanks kematzy

  • Loading branch information...
1 parent c08d5fa commit e67b4a9cd4bebfba38ffaf6e8bc60326f92237b9 @seaofclouds committed Mar 16, 2009
View
32 README
@@ -1,31 +1 @@
-This app was extracted from another sinatra app that I'd like to get working with Compass.
-
-== my environment ==
-
-sinatra (0.9.1.1)
-haml (2.1.0)
-chriseppstein-compass (0.5.3)
-
-# haml -v
- Haml 2.1.0.1ee16d0
-# sass -v
- Haml 2.1.0.1ee16d0
-# compass -v
- Compass 0.5.3
- Copyright (c) 2008 Chris Eppstein
- Released under the MIT License.
-
-== error ==
-
-NameError - uninitialized constant Haml::Engine
-
-app.rb:18:in `GET /'
-/Users/me/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack/methodoverride.rb:24:in `call'
-/Users/me/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack/commonlogger.rb:20:in `_call'
-/Users/me/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack/commonlogger.rb:13:in `call'
-/Users/me/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack/handler/thin.rb:11:in `run'
-app.rb:17
-
-Params
-
-{}
+This app is a simple starting point for those wanting to explore compass with sinatra.
View
18 app.rb
@@ -1,17 +1,17 @@
require 'rubygems'
-require 'compass'
+require 'compass' #must be loaded before sinatra
require 'sinatra'
+require 'haml' #must be loaded after sinatra
-configure do
- Compass.configuration do |config|
- config.project_path = File.dirname(__FILE__)
- config.sass_dir = "sass"
- end
-end
+# set sinatra's variables
+set :app_file, __FILE__
+set :root, File.dirname(__FILE__)
+set :views, "views"
-get '/stylesheets/screen.css' do
+#
+get '/stylesheets/:name.css' do
content_type 'text/css', :charset => 'utf-8'
- sass :screen, :sass => Compass.sass_engine_options
+ sass(:"stylesheets/#{params[:name]}", :sass => { :load_paths => ( [ File.join(Sinatra::Application.views, 'stylesheets') ] + Compass::Frameworks::ALL.map { |f| f.stylesheets_directory } ) } )
end
get '/' do
View
1 views/_footer.haml
@@ -1 +0,0 @@
-%p footer
View
1 views/_header.haml
@@ -1 +0,0 @@
-%h1 header
View
19 views/index.haml
@@ -1 +1,18 @@
-index content
+!!!
+!!! XML
+!!! Strict
+%html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", 'xml:lang' => "en" }
+ %head
+ %title compass sinatra
+ %meta{'http-equiv'=>"Content-Type", :content=>"text/html; charset=iso-8859-1"}/
+ %meta{'http-equiv'=>"Content-Language", :content=>"en-us"}/
+ %link{:href=>"/stylesheets/screen.css", :media=>"screen", :rel=>"stylesheet", :type=>"text/css"}/
+ %body
+ .container
+ .header
+ %h1 header
+ .body
+ %h2 body
+ %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ .footer
+ %p footer
View
17 views/layout.haml
@@ -1,17 +0,0 @@
-!!!
-!!! XML
-!!! Strict
-%html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", 'xml:lang' => "en" }
- %head
- %title compass sinatra
- %meta{'http-equiv'=>"Content-Type", :content=>"text/html; charset=iso-8859-1"}/
- %meta{'http-equiv'=>"Content-Language", :content=>"en-us"}/
- %link{:href=>"/stylesheets/screen.css", :media=>"screen", :rel=>"stylesheet", :type=>"text/css"}/
- %body
- .container
- .header
- = partial :header
- .body
- = yield
- .footer
- = partial :footer
View
0 sass/_base.sass → views/stylesheets/base.sass
File renamed without changes.
View
2 sass/screen.sass → views/stylesheets/screen.sass
@@ -1 +1,3 @@
@import base.sass
+
++blueprint

0 comments on commit e67b4a9

Please sign in to comment.