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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -108
  3. data/lib/pakyow/application/actions/presenter/auto_render.rb +17 -0
  4. data/lib/pakyow/application/behavior/presenter/error_rendering.rb +127 -0
  5. data/lib/pakyow/application/behavior/presenter/exposures.rb +31 -0
  6. data/lib/pakyow/application/behavior/presenter/implicit_rendering.rb +23 -0
  7. data/lib/pakyow/application/behavior/presenter/initializing.rb +69 -0
  8. data/lib/pakyow/application/behavior/presenter/modes.rb +120 -0
  9. data/lib/pakyow/application/behavior/presenter/versions.rb +73 -0
  10. data/lib/pakyow/application/behavior/presenter/watching.rb +23 -0
  11. data/lib/pakyow/{presenter/behavior/config.rb → application/config/presenter.rb} +3 -3
  12. data/lib/pakyow/application/helpers/presenter/rendering.rb +20 -0
  13. data/lib/pakyow/plugin/helpers/presenter/rendering.rb +34 -0
  14. data/lib/pakyow/presenter/errors.rb +1 -3
  15. data/lib/pakyow/presenter/framework.rb +18 -18
  16. data/lib/pakyow/presenter.rb +1 -1
  17. metadata +23 -24
  18. data/lib/pakyow/actions/presenter/auto_render.rb +0 -15
  19. data/lib/pakyow/plugin/helpers/rendering.rb +0 -32
  20. data/lib/pakyow/presenter/behavior/error_rendering.rb +0 -125
  21. data/lib/pakyow/presenter/behavior/exposures.rb +0 -29
  22. data/lib/pakyow/presenter/behavior/implicit_rendering.rb +0 -21
  23. data/lib/pakyow/presenter/behavior/initializing.rb +0 -67
  24. data/lib/pakyow/presenter/behavior/modes.rb +0 -118
  25. data/lib/pakyow/presenter/behavior/versions.rb +0 -71
  26. data/lib/pakyow/presenter/behavior/watching.rb +0 -21
  27. 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