Created
December 17, 2009 12:04
-
-
Save jsvd/258704 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra/base' | |
class Web < Sinatra::Base | |
get '/' do | |
"hello" | |
end | |
end | |
thread = Thread.new do | |
Web.run! | |
end | |
sleep 10 | |
thread.join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsvd@wayreth ~ % ruby -v | |
ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd8] | |
jsvd@wayreth ~ % gem list | grep sinatra | |
sinatra (0.9.4) | |
jsvd@wayreth ~ % ruby teste.rb | |
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from Mongrel | |
^C | |
== Sinatra has ended his set (crowd applauds) | |
^C | |
== Sinatra has ended his set (crowd applauds) | |
^C | |
== Sinatra has ended his set (crowd applauds) | |
jsvd@wayreth ~ % |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra/base' | |
class Web < Sinatra::Base | |
get '/' do | |
"hello" | |
end | |
end | |
thread = Thread.new do | |
Web.run! | |
trap(:INT) { exit } | |
end | |
sleep 10 | |
thread.join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsvd@wayreth ~ % ruby teste.rb | |
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from Mongrel | |
^C | |
== Sinatra has ended his set (crowd applauds) | |
^Cjsvd@wayreth ~ % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment