Browse files

Make demo Ruby 1.9 compatible

  • Loading branch information...
1 parent fc1c808 commit cfd528b88aef78a99a2873d9f215d5e123abe59b @mneumann committed Feb 24, 2009
Showing with 9 additions and 2 deletions.
  1. +9 −2 examples/demo.rb
View
11 examples/demo.rb
@@ -2,6 +2,11 @@
require 'rubygems'
require 'wee'
require 'rack'
+require 'wee/components/messagebox'
+
+class String
+ def each() yield self end
+end
class Wee::Application
attr_accessor :path, :description
@@ -52,17 +57,19 @@ def render(r)
MainPage.new
end
+if __FILE__ == $0
app = Rack::Builder.app do
use Rack::CommonLogger
use Rack::ShowExceptions
#use Rack::ShowStatus
- Wee::Application.applications.each do |a|
+ Wee::Application.applications.each {|a|
map a.path do
run a
end
- end
+ }
end
require 'rack/handler/webrick'
Rack::Handler::WEBrick.run(app, :Port => 2000)
+end

0 comments on commit cfd528b

Please sign in to comment.