192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
# File 'lib/sinatra/sinarey_reloader.rb', line 192
def deactivate(element)
case element.type
when :route then
verb = element.representation[:verb]
signature = element.representation[:signature]
block_id = signature.last
(blocks ||= {}).delete(block_id)
(routes[verb] ||= []).delete(signature)
when :turbo_route then
verb = element.representation[:verb]
path = element.representation[:path]
block_id = element.representation[:block_id]
(blocks ||= {}).delete(block_id)
(turbo_routes[verb] ||= {}).delete(path)
when :middleware then
@middleware.delete(element.representation)
when :before_filter then
filters[:before].delete(element.representation)
when :after_filter then
filters[:after].delete(element.representation)
when :error then
code = element.representation[:code]
handler = element.representation[:handler]
@errors.delete(code) if @errors[code] == handler
end
end
|