Initial commit

This commit is contained in:
Yessiest 2023-04-11 18:06:10 +04:00
commit d1fcac827d
2 changed files with 27 additions and 0 deletions

15
hyde.rb Normal file
View File

@ -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

12
test_webrick.rb Normal file
View File

@ -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