Sha256: 7d5994b63fbf4d619741d2e1bd8b3367c1f49400b03893b561d7bb8cc96128c8
Contents?: true
Size: 978 Bytes
Versions: 18
Compression:
Stored size: 978 Bytes
Contents
$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'tempfile' require 'ptools' require 'sinatra/base' require 'helpers/http_headers' module Mirage class Server < Sinatra::Base module Helpers module TemplateRequirements def convert_raw_required_params raw_requirements raw_requirements.collect { |requirement| requirement.split(":") }.inject({}) do |hash, pair| parameter, value = pair.collect { |string| string.strip } value = convert_value(value) hash[parameter] =value; hash end end def convert_raw_required_body_content_requirements raw_requirements raw_requirements.collect do |string| string.start_with?("%r{") && string.end_with?("}") ? eval(string) : string end end private def convert_value(value) value.start_with?("%r{") && value.end_with?("}") ? eval(value) : value end end end end end
Version data entries
18 entries across 18 versions & 2 rubygems