Sha256: 72ce06ee397f8c260d3f06247f2e00cb8f92a6eca4f092216529c7c1e7bc8378
Contents?: true
Size: 421 Bytes
Versions: 3
Compression:
Stored size: 421 Bytes
Contents
# encoding: UTF-8 module Mojito::Matchers module VirtualHost def HOST(pattern) proc do case pattern when String /#{pattern.gsub('**', '[^:]+').gsub('*', '[^:.]+')}/ === request.host_with_port when Array pattern.any? {|p| /#{p.gsub('**', '[^:]+').gsub('*', '[^:.]+')}/ === request.host_with_port } when Regexp pattern === request.host_with_port end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mojito-0.1.1 | lib/mojito/matchers/virtual_host.rb |
mojito-0.1.0 | lib/mojito/matchers/virtual_host.rb |
mojito-0.0.1 | lib/mojito/matchers/virtual_host.rb |