Zu nützlich um zu vergammeln :-)
This commit is contained in:
parent
c1dbba0891
commit
fbe364d506
|
@ -0,0 +1,21 @@
|
|||
[[Category:Ruby]]
|
||||
|
||||
<source lang="ruby">
|
||||
#!/usr/local/bin/ruby
|
||||
require 'webrick'
|
||||
include WEBrick
|
||||
|
||||
if ARGV.size != 2
|
||||
puts "Usage: #{$0} <port> <dir>"
|
||||
exit
|
||||
end
|
||||
|
||||
s = HTTPServer.new(
|
||||
:Port => ARGV[0].to_i,
|
||||
:DocumentRoot => ARGV[1]
|
||||
)
|
||||
|
||||
|
||||
trap("INT"){ s.shutdown }
|
||||
s.start
|
||||
</source>
|
Loading…
Reference in New Issue