File: handler.rb

package info (click to toggle)
puppet 4.8.2-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,736 kB
  • ctags: 14,616
  • sloc: ruby: 236,754; xml: 1,586; sh: 1,178; lisp: 299; sql: 103; yacc: 72; makefile: 52
file content (53 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'puppet/network/http/handler'

class PuppetSpec::Handler
  include Puppet::Network::HTTP::Handler

  def initialize(* routes)
    register(routes)
  end

  def set_content_type(response, format)
    response[:content_type_header] = format
  end

  def set_response(response, body, status = 200)
    response[:body] = body
    response[:status] = status
  end

  def http_method(request)
    request[:method]
  end

  def path(request)
    request[:path]
  end

  def params(request)
    request[:params]
  end

  def client_cert(request)
    request[:client_cert]
  end

  def body(request)
    request[:body]
  end

  def headers(request)
    request[:headers] || {}
  end
end

class PuppetSpec::HandlerProfiler
  def start(metric, description)
  end

  def finish(context, metric, description)
  end

  def shutdown()
  end
end