-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcssmod.rb
More file actions
54 lines (42 loc) · 1.09 KB
/
Copy pathcssmod.rb
File metadata and controls
54 lines (42 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#Rack version of the testbed
%w( rubygems haml compass sinatra/base rest_client hpricot ).each {|f| require f}
module CSSmod
class TinyApp < Sinatra::Base
#Setup sinatra to use Compass with the correct directorys
configure do
Compass.configuration do |conf|
conf.project_path = File.dirname(__FILE__)
conf.sass_dir = File.join('views', 'stylesheets')
end
end
#Viola a dynamically rendered sass stylesheet using compass mixins
# from blueprint
# amazing
#
get "/stylesheets/screen.css" do
puts Compass.sass_engine_options.inspect
content_type 'text/css'
sass :"stylesheets/screen", Compass.sass_engine_options
end
get "/" do
haml :content_part, :layout=>:layout
end
get "/form" do
haml :form
end
post "/form" do
s = params[:sometext]
puts s
redirect s
end
get "/dorss" do
resp = RestClient.get 'http://photo.rwboyer.com/feed/'
doc, @posts = Hpricot.XML(resp.to_s), []
(doc/:description).each do |p|
content = p.inner_html.gsub!(/\<\!\[CDATA\[(.*)\]\]\>/m, '\1')
@posts << content
end
haml :rsspage
end
end
end