-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcssnew.rb
43 lines (36 loc) · 904 Bytes
/
cssnew.rb
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
%w( rubygems sinatra compass rest_client hpricot ).each {|f| require f}
#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
content_type 'text/css'
sass :"stylesheets/screen", Compass.sass_engine_options
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/'
puts resp.class
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
get "/" do
haml :content_part
end