module Sinatra::Base

Public Class Methods

compile!(verb, path, *args, &block) click to toggle source
# File lib/skylight/core/probes/sinatra.rb, line 15
def compile!(verb, path, *args, &block)
  compile_without_sk!(verb, path, *args, &block).tap do |_, _, keys_or_wrapper, wrapper|
    wrapper ||= keys_or_wrapper

    # Deal with the situation where the path is a regex, and the default behavior
    # of Ruby stringification produces an unreadable mess
    if path.is_a?(Regexp)
      human_readable = "<sk-regex>%r{#{path.source}}</sk-regex>"
      wrapper.instance_variable_set(:@route_name, "#{verb} #{human_readable}")
    else
      wrapper.instance_variable_set(:@route_name, "#{verb} #{path}")
    end
  end
end
Also aliased as: compile_without_sk!
compile_without_sk!(verb, path, *args, &block)
Alias for: compile!