Initial commit
This commit is contained in:
commit
d1fcac827d
|
@ -0,0 +1,15 @@
|
|||
require 'webrick'
|
||||
|
||||
module Hyde
|
||||
class Pathspec
|
||||
def initialize (path, &block)
|
||||
@path = path.split "/" if path.kind_of? String
|
||||
@path = [path] if path.kind_of? Regexp
|
||||
@chain = []
|
||||
self.instance_eval &block
|
||||
end
|
||||
def path(*a, **b, &block)
|
||||
@chain.append Hyde::Pathspec.new *a, **b, &block
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
require 'webrick'
|
||||
|
||||
root = File.expand_path '~/hyde/'
|
||||
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root
|
||||
|
||||
trap 'INT' do server.shutdown end
|
||||
server.mount_proc '/' do |req, res|
|
||||
res.body = 'Hello, world!'
|
||||
end
|
||||
server.start
|
||||
|
||||
|
Loading…
Reference in New Issue