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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/pakyow/routing/framework.rb', line 20
def boot
object.class_eval do
include Pakyow::Application::Behavior::Routing::Definition
isolate Controller do
include Extension::Resource
end
stateful :controller, isolated(:Controller) do |args, _opts|
if self.ancestors.include?(Plugin)
name, matcher = Controller.send(:parse_name_and_matcher_from_args, *args)
path = File.join(@mount_path, Controller.send(:path_from_matcher, matcher).to_s)
args.replace([name, path])
end
end
aspect :controllers
aspect :resources
register_helper :active, Helpers::Exposures
on "load" do
self.class.include_helpers :active, isolated(:Controller)
end
after "initialize" do
@global_controller = isolated(:Controller).new(self)
end
def controller_for_connection(connection)
@global_controller.dup.tap do |controller|
controller.instance_variable_set(:@connection, connection)
end
end
require "pakyow/support/message_verifier"
handle Support::MessageVerifier::TamperedMessage, as: :forbidden
include Security::Config
include Security::Behavior::Disabling
include Security::Behavior::Helpers
include Security::Behavior::Insecure
include Security::Behavior::Pipeline
end
end
|