From 09e9dad38a6999b2ba1dac132d8233574191f8c3 Mon Sep 17 00:00:00 2001 From: Michael Neumann Date: Tue, 19 Oct 2010 12:42:44 +0200 Subject: [PATCH] Continuations enabled by default Remove Wee.runcc --- examples/arc_challenge2.rb | 2 +- examples/cheese_task.rb | 2 +- examples/continuations.rb | 2 +- examples/demo.rb | 5 ++--- lib/wee.rb | 11 +---------- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/examples/arc_challenge2.rb b/examples/arc_challenge2.rb index 3a06555..605c164 100644 --- a/examples/arc_challenge2.rb +++ b/examples/arc_challenge2.rb @@ -43,4 +43,4 @@ def go end end -Wee.runcc(ArcChallenge) if __FILE__ == $0 +Wee.run(ArcChallenge) if __FILE__ == $0 diff --git a/examples/cheese_task.rb b/examples/cheese_task.rb index 50dddb4..f2a439d 100644 --- a/examples/cheese_task.rb +++ b/examples/cheese_task.rb @@ -24,4 +24,4 @@ def inform_cheese end end -Wee.runcc(CheeseTask) if __FILE__ == $0 +Wee.run(CheeseTask) if __FILE__ == $0 diff --git a/examples/continuations.rb b/examples/continuations.rb index 116ebd1..b84a1f6 100644 --- a/examples/continuations.rb +++ b/examples/continuations.rb @@ -25,4 +25,4 @@ def render(r) end -Wee.runcc(MainPage) +Wee.run(MainPage) diff --git a/examples/demo.rb b/examples/demo.rb index 6d956ab..5c088d3 100644 --- a/examples/demo.rb +++ b/examples/demo.rb @@ -127,10 +127,9 @@ def render(r) if __FILE__ == $0 if ARGV[0] == "cc" - # Enable continuation demos $cc = true - Wee.runcc(Demo) - else Wee.run(Demo) + else + Wee.run(Demo, :use_continuations => false) end end diff --git a/lib/wee.rb b/lib/wee.rb index c9dea05..6734bf7 100644 --- a/lib/wee.rb +++ b/lib/wee.rb @@ -44,7 +44,7 @@ def Wee.run(component_class=nil, params=nil, &block) params[:port] ||= 2000 params[:public_path] ||= nil params[:additional_builder_procs] ||= [] - params[:use_continuations] ||= false + params[:use_continuations] ||= true params[:print_message] ||= false params[:autoreload] ||= false @@ -107,12 +107,3 @@ def Wee.run(component_class=nil, params=nil, &block) Rack::Handler::WEBrick.run(app, :Port => params[:port]) end - -# -# Like Wee.run, but for use with continuations. -# -def Wee.runcc(component_class, params=nil) - params ||= Hash.new - params[:use_continuations] = true - Wee.run(component_class, params) -end