pakyow-presenter 1.0.0.rc5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -108
- data/lib/pakyow/application/actions/presenter/auto_render.rb +17 -0
- data/lib/pakyow/application/behavior/presenter/error_rendering.rb +127 -0
- data/lib/pakyow/application/behavior/presenter/exposures.rb +31 -0
- data/lib/pakyow/application/behavior/presenter/implicit_rendering.rb +23 -0
- data/lib/pakyow/application/behavior/presenter/initializing.rb +69 -0
- data/lib/pakyow/application/behavior/presenter/modes.rb +120 -0
- data/lib/pakyow/application/behavior/presenter/versions.rb +73 -0
- data/lib/pakyow/application/behavior/presenter/watching.rb +23 -0
- data/lib/pakyow/{presenter/behavior/config.rb → application/config/presenter.rb} +3 -3
- data/lib/pakyow/application/helpers/presenter/rendering.rb +20 -0
- data/lib/pakyow/plugin/helpers/presenter/rendering.rb +34 -0
- data/lib/pakyow/presenter/errors.rb +1 -3
- data/lib/pakyow/presenter/framework.rb +18 -18
- data/lib/pakyow/presenter.rb +1 -1
- metadata +23 -24
- data/lib/pakyow/actions/presenter/auto_render.rb +0 -15
- data/lib/pakyow/plugin/helpers/rendering.rb +0 -32
- data/lib/pakyow/presenter/behavior/error_rendering.rb +0 -125
- data/lib/pakyow/presenter/behavior/exposures.rb +0 -29
- data/lib/pakyow/presenter/behavior/implicit_rendering.rb +0 -21
- data/lib/pakyow/presenter/behavior/initializing.rb +0 -67
- data/lib/pakyow/presenter/behavior/modes.rb +0 -118
- data/lib/pakyow/presenter/behavior/versions.rb +0 -71
- data/lib/pakyow/presenter/behavior/watching.rb +0 -21
- data/lib/pakyow/presenter/helpers/rendering.rb +0 -18
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "pakyow/support/extension"
|
4
|
-
|
5
|
-
module Pakyow
|
6
|
-
module Presenter
|
7
|
-
module Behavior
|
8
|
-
module Versions
|
9
|
-
extend Support::Extension
|
10
|
-
|
11
|
-
apply_extension do
|
12
|
-
if ancestors.include?(Plugin)
|
13
|
-
# Copy global versioning logic from other plugins to this plugin.
|
14
|
-
#
|
15
|
-
after "load" do
|
16
|
-
presenters = [isolated(:Presenter)].concat(state(:presenter))
|
17
|
-
|
18
|
-
parent.plugs.each do |plug|
|
19
|
-
plug.isolated(:Presenter).__versioning_logic.each_pair do |version, logic_arr|
|
20
|
-
logic_arr.each do |logic|
|
21
|
-
presenters.each do |presenter|
|
22
|
-
unless presenter.__versioning_logic.include?(version)
|
23
|
-
plug_namespace = plug.class.__object_name.namespace.parts.last
|
24
|
-
|
25
|
-
prefix = if plug_namespace == :default
|
26
|
-
plug.class.plugin_name
|
27
|
-
else
|
28
|
-
"#{plug.class.plugin_name}(#{plug_namespace})"
|
29
|
-
end
|
30
|
-
|
31
|
-
presenter.version :"@#{prefix}.#{version}" do |object|
|
32
|
-
instance_exec(object, plug, &logic[:block])
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
else
|
41
|
-
# Copy global versioning logic from plugin presenters.
|
42
|
-
#
|
43
|
-
after "load.plugins" do
|
44
|
-
presenters = [isolated(:Presenter)].concat(state(:presenter))
|
45
|
-
|
46
|
-
plugs.each do |plug|
|
47
|
-
plug.isolated(:Presenter).__versioning_logic.each_pair do |version, logic_arr|
|
48
|
-
logic_arr.each do |logic|
|
49
|
-
presenters.each do |presenter|
|
50
|
-
plug_namespace = plug.class.__object_name.namespace.parts.last
|
51
|
-
|
52
|
-
prefix = if plug_namespace == :default
|
53
|
-
plug.class.plugin_name
|
54
|
-
else
|
55
|
-
"#{plug.class.plugin_name}(#{plug_namespace})"
|
56
|
-
end
|
57
|
-
|
58
|
-
presenter.version :"@#{prefix}.#{version}" do |object|
|
59
|
-
instance_exec(object, plug, &logic[:block])
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "pakyow/support/extension"
|
4
|
-
|
5
|
-
module Pakyow
|
6
|
-
module Presenter
|
7
|
-
module Behavior
|
8
|
-
module Watching
|
9
|
-
extend Support::Extension
|
10
|
-
|
11
|
-
apply_extension do
|
12
|
-
after "load" do
|
13
|
-
([:html] + state(:processor).map(&:extensions).flatten).uniq.each do |extension|
|
14
|
-
config.process.watched_paths << File.join(config.presenter.path, "**/*.#{extension}")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Pakyow
|
4
|
-
module Presenter
|
5
|
-
module Helpers
|
6
|
-
module Rendering
|
7
|
-
def render(view_path = nil, as: nil, modes: [:default])
|
8
|
-
@connection.app.isolated(:Renderer).render(
|
9
|
-
@connection,
|
10
|
-
view_path: view_path,
|
11
|
-
presenter_path: as,
|
12
|
-
modes: modes
|
13
|
-
)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|