Slide 47
Slide 47 text
࣮ DMBTT5SBDF)FBEFS
30 def tracer
31 TracePoint.new(:call, :return) do |tp|
32 if tp.rack_middleware_called?
33 if tp.event.eql?(:call) \
34 && !@datas.find { |op| op[:middleware].eql? tp.defined_class }
35 @datas << { middleware: tp.defined_class,
36 app: tp.self.deep_dup,
37 env: tp.binding.local_variable_get(:env).deep_dup }
38 end
39
40 @fixed_app = tp.return_value if tp.event.eql?(:return)
41 end
42 end
43
44 def result
45 Result.new(@app, @datas)
46 end
47 end
5SBDF1PJOUΛΠϯελϯεԽ
ϝιουݺͼग़͠ͱϦλʔϯ࣌ʹ
ϒϩοΫͷॲཧΛ࣮ߦ͢Δ