This commit is contained in:
Yessiest 2023-04-12 00:52:10 +04:00
parent d1fcac827d
commit ac2dd66f36
1 changed files with 23 additions and 5 deletions

28
hyde.rb
View File

@ -1,15 +1,33 @@
require 'webrick'
module Hyde
class Pathspec
def initialize (path, &block)
@path = path.split "/" if path.kind_of? String
class Servlet
def initialize (path, &block_optional)
end
end
class Pathspec
def initialize (path, &block, root: nil)
@path = (path.split "/").filter {|x| x != ""} if path.kind_of? String
@path = [path] if path.kind_of? Regexp
@chain = []
@root_override = root
@remap = false
self.instance_eval &block
end
def path(*a, **b, &block)
@chain.append Hyde::Pathspec.new *a, **b, &block
end
def root(path)
@root_override = root
end
def remap(path)
@root_override = root
@remap = true
end
def match(path)
end
def match?(path)
end
end
end