hobo 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/hobo +21 -22
- data/hobo_files/plugin/CHANGES.txt +429 -4
- data/hobo_files/plugin/Rakefile +2 -2
- data/hobo_files/plugin/generators/hobo_front_controller/templates/index.dryml +6 -5
- data/hobo_files/plugin/generators/hobo_front_controller/templates/search.dryml +2 -2
- data/hobo_files/plugin/generators/hobo_migration/hobo_migration_generator.rb +20 -15
- data/hobo_files/plugin/generators/hobo_model/templates/model.rb +1 -0
- data/hobo_files/plugin/generators/hobo_model_controller/templates/controller.rb +2 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_base.css +1 -2
- data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.css +4 -3
- data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.js +94 -12
- data/hobo_files/plugin/generators/hobo_rapid/templates/lowpro.js +5 -183
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css +1 -1
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views/application.dryml +23 -1
- data/hobo_files/plugin/generators/hobo_user_controller/templates/controller.rb +2 -0
- data/hobo_files/plugin/generators/hobo_user_model/templates/model.rb +3 -1
- data/hobo_files/plugin/init.rb +18 -7
- data/hobo_files/plugin/lib/active_record/has_many_association.rb +2 -2
- data/hobo_files/plugin/lib/extensions.rb +56 -12
- data/hobo_files/plugin/lib/hobo.rb +25 -88
- data/hobo_files/plugin/lib/hobo/composite_model.rb +2 -0
- data/hobo_files/plugin/lib/hobo/controller.rb +40 -20
- data/hobo_files/plugin/lib/hobo/dryml.rb +122 -106
- data/hobo_files/plugin/lib/hobo/dryml/dryml_builder.rb +2 -1
- data/hobo_files/plugin/lib/hobo/dryml/part_context.rb +3 -2
- data/hobo_files/plugin/lib/hobo/dryml/taglib.rb +19 -3
- data/hobo_files/plugin/lib/hobo/dryml/template.rb +40 -25
- data/hobo_files/plugin/lib/hobo/dryml/template_environment.rb +41 -20
- data/hobo_files/plugin/lib/hobo/email_address.rb +4 -1
- data/hobo_files/plugin/lib/hobo/enum_string.rb +50 -0
- data/hobo_files/plugin/lib/hobo/field_declaration_dsl.rb +36 -0
- data/hobo_files/plugin/lib/hobo/field_spec.rb +4 -7
- data/hobo_files/plugin/lib/hobo/hobo_helper.rb +47 -44
- data/hobo_files/plugin/lib/hobo/html_string.rb +2 -0
- data/hobo_files/plugin/lib/hobo/markdown_string.rb +2 -0
- data/hobo_files/plugin/lib/hobo/model.rb +158 -89
- data/hobo_files/plugin/lib/hobo/model_controller.rb +422 -376
- data/hobo_files/plugin/lib/hobo/model_queries.rb +1 -1
- data/hobo_files/plugin/lib/hobo/model_router.rb +174 -0
- data/hobo_files/plugin/lib/hobo/password_string.rb +2 -0
- data/hobo_files/plugin/lib/hobo/percentage.rb +14 -0
- data/hobo_files/plugin/lib/hobo/plugins.rb +4 -4
- data/hobo_files/plugin/lib/hobo/rapid_helper.rb +10 -2
- data/hobo_files/plugin/lib/hobo/text.rb +3 -3
- data/hobo_files/plugin/lib/hobo/textile_string.rb +2 -0
- data/hobo_files/plugin/lib/hobo/undefined.rb +3 -2
- data/hobo_files/plugin/lib/hobo/{authenticated_user.rb → user.rb} +10 -3
- data/hobo_files/plugin/lib/hobo/user_controller.rb +27 -23
- data/hobo_files/plugin/tags/core.dryml +8 -2
- data/hobo_files/plugin/tags/rapid.dryml +52 -40
- data/hobo_files/plugin/tags/rapid_document_tags.dryml +15 -11
- data/hobo_files/plugin/tags/rapid_editing.dryml +41 -9
- data/hobo_files/plugin/tags/rapid_forms.dryml +136 -36
- data/hobo_files/plugin/tags/rapid_navigation.dryml +2 -2
- data/hobo_files/plugin/tags/rapid_pages.dryml +204 -221
- data/hobo_files/plugin/tags/rapid_plus.dryml +8 -6
- data/hobo_files/plugin/tags/rapid_support.dryml +2 -3
- metadata +44 -42
- data/hobo_files/plugin/lib/hobo/define_tags.rb +0 -56
- data/hobo_files/plugin/lib/hobo/http_parameters.rb +0 -225
@@ -1,143 +1,159 @@
|
|
1
|
-
module Hobo
|
1
|
+
module Hobo
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
module Dryml
|
4
|
+
|
5
|
+
class DrymlSyntaxError < RuntimeError; end
|
6
|
+
|
7
|
+
class DrymlException < Exception
|
8
|
+
def initialize(message, path=nil, line_num=nil)
|
9
|
+
if path && line_num
|
10
|
+
super(message + " -- at #{path}:#{line_num}")
|
11
|
+
else
|
12
|
+
super(message)
|
13
|
+
end
|
11
14
|
end
|
12
15
|
end
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
TagDef = Struct.new "TagDef", :name, :attrs, :proc
|
20
|
-
|
21
|
-
RESERVED_WORDS = %w{if for while do class else elsif unless case when module in}
|
22
|
-
|
23
|
-
EMPTY_PAGE = "[tag-page]"
|
16
|
+
|
17
|
+
class AttributeExtensionString < String;
|
18
|
+
def drop_prefix; self[2..-1]; end
|
19
|
+
end
|
24
20
|
|
25
|
-
|
26
|
-
CORE_TAGLIB = "plugins/hobo/tags/core"
|
21
|
+
TagDef = Struct.new "TagDef", :name, :attrs, :proc
|
27
22
|
|
28
|
-
|
29
|
-
@tag_page_renderer_classes = {}
|
23
|
+
RESERVED_WORDS = %w{if for while do class else elsif unless case when module in}
|
30
24
|
|
31
|
-
|
25
|
+
EMPTY_PAGE = "[tag-page]"
|
32
26
|
|
33
|
-
|
27
|
+
APPLICATION_TAGLIB = "taglibs/application"
|
28
|
+
CORE_TAGLIB = "plugins/hobo/tags/core"
|
34
29
|
|
35
|
-
|
36
|
-
@renderer_classes = {}
|
37
|
-
@tag_page_renderer_classes = {}
|
38
|
-
end
|
30
|
+
DEFAULT_IMPORTS = [Hobo::HoboHelper, ApplicationHelper]
|
39
31
|
|
40
|
-
|
41
|
-
|
42
|
-
renderer.render_tag(tag, options)
|
43
|
-
end
|
32
|
+
@renderer_classes = {}
|
33
|
+
@tag_page_renderer_classes = {}
|
44
34
|
|
35
|
+
class << self
|
45
36
|
|
46
|
-
|
47
|
-
|
48
|
-
|
37
|
+
attr_accessor :last_if
|
38
|
+
|
39
|
+
def clear_cache
|
40
|
+
@renderer_classes = {}
|
41
|
+
@tag_page_renderer_classes = {}
|
42
|
+
end
|
43
|
+
|
44
|
+
def render_tag(view, tag, options={})
|
45
|
+
renderer = empty_page_renderer(view)
|
46
|
+
renderer.render_tag(tag, options)
|
47
|
+
end
|
49
48
|
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
Taglib.clear_cache
|
50
|
+
def empty_page_renderer(view)
|
51
|
+
controller_name = view.controller.class.name.underscore.sub(/_controller$/, "")
|
52
|
+
page_renderer(view, [], "#{controller_name}/#{EMPTY_PAGE}")
|
55
53
|
end
|
56
54
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
if page == EMPTY_PAGE
|
65
|
-
@tag_page_renderer_classes[view.controller.class.name] ||= make_renderer_class("", EMPTY_PAGE, local_names,
|
66
|
-
[Hobo::HoboHelper, ApplicationHelper], included_taglibs)
|
67
|
-
@tag_page_renderer_classes[view.controller.class.name].new(page, view)
|
68
|
-
else
|
55
|
+
|
56
|
+
def page_renderer(view, local_names=[], page=nil)
|
57
|
+
if RAILS_ENV == "development"
|
58
|
+
clear_cache
|
59
|
+
Taglib.clear_cache
|
60
|
+
end
|
69
61
|
page ||= view.instance_variable_get('@hobo_template_path')
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
62
|
+
|
63
|
+
prepare_view!(view)
|
64
|
+
included_taglibs = ([subsite_taglib(page)] + controller_taglibs(page)).compact
|
65
|
+
|
66
|
+
if page.ends_with?(EMPTY_PAGE)
|
67
|
+
controller_class = controller_class_for(page)
|
68
|
+
@tag_page_renderer_classes[controller_class.name] ||=
|
69
|
+
make_renderer_class("", page, local_names, DEFAULT_IMPORTS, included_taglibs)
|
70
|
+
@tag_page_renderer_classes[controller_class.name].new(page, view)
|
71
|
+
else
|
72
|
+
template_path = "app/views/" + page + ".dryml"
|
73
|
+
src_file = File.new(File.join(RAILS_ROOT, template_path))
|
74
|
+
renderer_class = @renderer_classes[page]
|
75
|
+
|
76
|
+
# do we need to recompile?
|
77
|
+
if (!renderer_class or # nothing cached?
|
78
|
+
(local_names - renderer_class.compiled_local_names).any? or # any new local names?
|
79
|
+
renderer_class.load_time < src_file.mtime) # cache out of date?
|
80
|
+
renderer_class = make_renderer_class(src_file.read, template_path, local_names,
|
81
|
+
DEFAULT_IMPORTS, included_taglibs)
|
82
|
+
renderer_class.load_time = src_file.mtime
|
83
|
+
@renderer_classes[page] = renderer_class
|
84
|
+
end
|
85
|
+
renderer_class.new(page, view)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
def controller_class_for(page)
|
91
|
+
controller, view = Controller.controller_and_view_for(page)
|
92
|
+
"#{controller.camelize}Controller".constantize
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
def controller_taglibs(page)
|
97
|
+
controller_class = controller_class_for(page)
|
98
|
+
(controller_class.respond_to?(:included_taglibs) && controller_class.included_taglibs) || []
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
def subsite_taglib(page)
|
103
|
+
parts = page.split("/")
|
104
|
+
if parts.length == 3
|
105
|
+
subsite = parts.first
|
106
|
+
"taglibs/#{subsite}" if File.exists?("#{RAILS_ROOT}/app/views/taglibs/#{subsite}.dryml")
|
82
107
|
end
|
83
|
-
renderer_class.new(page, view)
|
84
108
|
end
|
85
|
-
end
|
86
109
|
|
87
110
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
111
|
+
def prepare_view!(view)
|
112
|
+
# Not sure why this isn't done for me...
|
113
|
+
# There's probably a button to press round here somewhere
|
114
|
+
for var in %w(@flash @cookies @action_name @_session @_request @request_origin
|
92
115
|
@template @request @ignore_missing_templates @_headers @variables_added
|
93
116
|
@_flash @response @template_class
|
94
117
|
@_cookies @before_filter_chain_aborted @url
|
95
118
|
@_response @template_root @headers @_params @params @session)
|
96
|
-
|
97
|
-
|
119
|
+
unless @view.instance_variables.include?(var)
|
120
|
+
view.instance_variable_set(var, view.controller.instance_variable_get(var))
|
121
|
+
end
|
98
122
|
end
|
99
123
|
end
|
100
124
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
imports << controller_helper.constantize if Object.const_defined? controller_helper
|
108
|
-
imports
|
109
|
-
end
|
110
|
-
|
111
|
-
|
112
|
-
def make_renderer_class(template_src, template_path, locals, imports, included_taglibs=[])
|
113
|
-
renderer_class = Class.new(TemplateEnvironment)
|
114
|
-
compile_renderer_class(renderer_class, template_src, template_path, locals, imports, included_taglibs)
|
115
|
-
renderer_class
|
116
|
-
end
|
125
|
+
|
126
|
+
def make_renderer_class(template_src, template_path, locals, imports, included_taglibs=[])
|
127
|
+
renderer_class = Class.new(TemplateEnvironment)
|
128
|
+
compile_renderer_class(renderer_class, template_src, template_path, locals, imports, included_taglibs)
|
129
|
+
renderer_class
|
130
|
+
end
|
117
131
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
132
|
+
|
133
|
+
def compile_renderer_class(renderer_class, template_src, template_path, locals, imports, included_taglibs=[])
|
134
|
+
template = Template.new(template_src, renderer_class, template_path)
|
135
|
+
imports.each {|m| template.import_module(m)}
|
122
136
|
|
123
|
-
|
137
|
+
taglibs = [CORE_TAGLIB, APPLICATION_TAGLIB] + included_taglibs
|
124
138
|
|
125
|
-
|
126
|
-
|
139
|
+
# the sum of all the names we've seen so far - eventually we'll be ready for all of 'em
|
140
|
+
all_local_names = renderer_class.compiled_local_names | locals
|
127
141
|
|
128
|
-
|
129
|
-
|
142
|
+
template.compile(all_local_names, taglibs)
|
143
|
+
end
|
130
144
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
145
|
+
|
146
|
+
def unreserve(word)
|
147
|
+
word = word.to_s
|
148
|
+
if RESERVED_WORDS.include?(word)
|
149
|
+
word + "_"
|
150
|
+
else
|
151
|
+
word
|
152
|
+
end
|
138
153
|
end
|
154
|
+
|
139
155
|
end
|
140
|
-
|
156
|
+
|
141
157
|
end
|
142
158
|
|
143
159
|
end
|
@@ -94,7 +94,8 @@ module Hobo::Dryml
|
|
94
94
|
@environment.send(:alias_method, instruction[:new], instruction[:old])
|
95
95
|
|
96
96
|
else
|
97
|
-
raise RuntimeError.new("DRYML: Unknown build instruction :#{instruction[:type]},
|
97
|
+
raise RuntimeError.new("DRYML: Unknown build instruction :#{instruction[:type]}, " +
|
98
|
+
"building #{template_path}")
|
98
99
|
end
|
99
100
|
end
|
100
101
|
@last_build_time = Time.now
|
@@ -20,7 +20,7 @@ module Hobo
|
|
20
20
|
|
21
21
|
contexts.map do |dom_id, context|
|
22
22
|
code = context.marshal(session).split("\n").map{|line| "'#{line}\\n'"}.join(" +\n ")
|
23
|
-
"hoboParts.#{dom_id} = (#{code})
|
23
|
+
"hoboParts.#{dom_id} = (#{code});\n"
|
24
24
|
end.join
|
25
25
|
end
|
26
26
|
|
@@ -28,7 +28,7 @@ module Hobo
|
|
28
28
|
def initialize(part_name, this_id, locals)
|
29
29
|
@part_name = part_name
|
30
30
|
@this_id = this_id
|
31
|
-
@locals = locals.map {|l| pre_marshal(l) }
|
31
|
+
@locals = locals.map { |l| pre_marshal(l) }
|
32
32
|
end
|
33
33
|
|
34
34
|
|
@@ -66,6 +66,7 @@ module Hobo
|
|
66
66
|
raise TamperedWithPartContext unless digest == generate_digest(data, session)
|
67
67
|
|
68
68
|
part_name, this_id, locals = Marshal.load(Base64.decode64(data))
|
69
|
+
RAILS_DEFAULT_LOGGER.info("Call part: #{part_name}. this-id = #{this_id}, locals = #{locals.inspect}")
|
69
70
|
|
70
71
|
[part_name, restore_part_this(this_id, this), restore_locals(locals)]
|
71
72
|
end
|
@@ -37,13 +37,29 @@ module Hobo::Dryml
|
|
37
37
|
|
38
38
|
def load
|
39
39
|
@module = Module.new do
|
40
|
+
|
40
41
|
@tag_attrs = {}
|
41
|
-
|
42
|
-
|
43
|
-
end
|
42
|
+
@tag_aliases = {}
|
43
|
+
|
44
44
|
class << self
|
45
|
+
|
46
|
+
def included(base)
|
47
|
+
@tag_aliases.each do |tag, feature|
|
48
|
+
base.send(:alias_tag_chain, tag, feature)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def _register_tag_attrs(tag, attrs)
|
53
|
+
@tag_attrs[tag] = attrs
|
54
|
+
end
|
45
55
|
attr_reader :tag_attrs
|
56
|
+
|
57
|
+
def _alias_tag_chain(tag, feature)
|
58
|
+
@tag_aliases[tag] = feature
|
59
|
+
end
|
60
|
+
|
46
61
|
end
|
62
|
+
|
47
63
|
end
|
48
64
|
@file.rewind
|
49
65
|
template = Template.new(@file.read, @module, @file.path)
|
@@ -9,7 +9,11 @@ module Hobo::Dryml
|
|
9
9
|
|
10
10
|
CODE_ATTRIBUTE_CHAR = "&"
|
11
11
|
|
12
|
-
SPECIAL_ATTRIBUTES = %w(param
|
12
|
+
SPECIAL_ATTRIBUTES = %w(param merge merge_params merge_attrs
|
13
|
+
for_type
|
14
|
+
if unless repeat
|
15
|
+
part part_locals
|
16
|
+
restore)
|
13
17
|
|
14
18
|
@build_cache = {}
|
15
19
|
|
@@ -39,7 +43,7 @@ module Hobo::Dryml
|
|
39
43
|
def compile(local_names=[], auto_taglibs=[])
|
40
44
|
now = Time.now
|
41
45
|
|
42
|
-
unless @template_path
|
46
|
+
unless @template_path.ends_with?(EMPTY_PAGE)
|
43
47
|
filename = RAILS_ROOT + (@template_path.starts_with?("/") ? @template_path : "/" + @template_path)
|
44
48
|
mtime = File.stat(filename).mtime rescue nil
|
45
49
|
end
|
@@ -230,7 +234,7 @@ module Hobo::Dryml
|
|
230
234
|
require_attribute(el, "tag", DRYML_NAME_RX)
|
231
235
|
require_attribute(el, "attrs", /^\s*#{DRYML_NAME}(\s*,\s*#{DRYML_NAME})*\s*$/, true)
|
232
236
|
require_attribute(el, "alias_of", DRYML_NAME_RX, true)
|
233
|
-
require_attribute(el, "
|
237
|
+
require_attribute(el, "extend_with", DRYML_NAME_RX, true)
|
234
238
|
|
235
239
|
unsafe_name = el.attributes["tag"]
|
236
240
|
name = Hobo::Dryml.unreserve(unsafe_name)
|
@@ -254,26 +258,28 @@ module Hobo::Dryml
|
|
254
258
|
@def_name = @def_name ? "#{@def_name}_#{unsafe_name}" : unsafe_name
|
255
259
|
|
256
260
|
alias_of = el.attributes['alias_of']
|
257
|
-
|
261
|
+
extend_with = el.attributes['extend_with']
|
258
262
|
|
259
|
-
dryml_exception("def cannot have both alias_of and
|
263
|
+
dryml_exception("def cannot have both alias_of and extend_with", el) if alias_of && extend_with
|
260
264
|
dryml_exception("def with alias_of must be empty", el) if alias_of and el.size > 0
|
261
265
|
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
@builder.add_build_instruction(:alias_method, :new => new_name.to_sym, :old => old_name.to_sym)
|
267
|
-
end
|
266
|
+
|
267
|
+
@builder.add_build_instruction(:alias_method,
|
268
|
+
:new => name.to_sym, :old => alias_of.to_sym) if alias_of
|
268
269
|
|
269
270
|
res = if alias_of
|
270
271
|
"<% #{tag_newlines(el)} %>"
|
271
272
|
else
|
272
|
-
src =
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
273
|
+
src = ""
|
274
|
+
if extend_with
|
275
|
+
src << "<% _alias_tag_chain :#{name}, :#{extend_with} %>"
|
276
|
+
name = extended_name(name, extend_with)
|
277
|
+
end
|
278
|
+
src << if template_name?(name)
|
279
|
+
template_method(name, el)
|
280
|
+
else
|
281
|
+
tag_method(name, el)
|
282
|
+
end
|
277
283
|
src << "<% _register_tag_attrs(:#{name}, #{declared_attributes(el).inspect}) %>"
|
278
284
|
|
279
285
|
logger.debug(restore_erb_scriptlets(src)) if el.attributes["debug_source"]
|
@@ -289,8 +295,17 @@ module Hobo::Dryml
|
|
289
295
|
end
|
290
296
|
|
291
297
|
|
298
|
+
def extended_name(name, feature)
|
299
|
+
if template_name?(name)
|
300
|
+
"#{name}With#{feature.camelize}"
|
301
|
+
else
|
302
|
+
"#{name}_with_#{feature}"
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
|
292
307
|
def template_call?(el)
|
293
|
-
template_name?(el.
|
308
|
+
template_name?(el.dryml_name)
|
294
309
|
end
|
295
310
|
|
296
311
|
|
@@ -386,7 +401,7 @@ module Hobo::Dryml
|
|
386
401
|
|
387
402
|
part_locals = el.attributes["part_locals"]
|
388
403
|
|
389
|
-
part_src = "<% def #{part_name}_part(#{part_locals}) #{tag_newlines(el)}; new_context do %>" +
|
404
|
+
part_src = "<% def #{part_name}_part(#{part_locals._?.gsub('@', '')}) #{tag_newlines(el)}; new_context do %>" +
|
390
405
|
content +
|
391
406
|
"<% end; end %>"
|
392
407
|
@builder.add_part(part_name, restore_erb_scriptlets(part_src), element_line_num(el))
|
@@ -408,9 +423,9 @@ module Hobo::Dryml
|
|
408
423
|
|
409
424
|
res = param_name == "&true" ? el.dryml_name : param_name
|
410
425
|
|
411
|
-
dryml_exception("param
|
426
|
+
dryml_exception("param '#{res}' is for a template call must be capitalised", el) if
|
412
427
|
res && template_call?(el) && !template_name?(res)
|
413
|
-
dryml_exception("param
|
428
|
+
dryml_exception("param '#{res}' is for a block-tag call and must not be capitalised", el) if
|
414
429
|
res && !template_call?(el) && template_name?(res)
|
415
430
|
|
416
431
|
res
|
@@ -456,7 +471,7 @@ module Hobo::Dryml
|
|
456
471
|
to_call = if is_param_default_call
|
457
472
|
# The tag is available in a local variable
|
458
473
|
# holding a proc
|
459
|
-
|
474
|
+
name
|
460
475
|
elsif (call_type = polymorphic_call_type(el))
|
461
476
|
"find_polymorphic_template(:#{name}, #{call_type})"
|
462
477
|
else
|
@@ -501,9 +516,9 @@ module Hobo::Dryml
|
|
501
516
|
param_name = get_param_name(e)
|
502
517
|
if param_name
|
503
518
|
if template_call?(e)
|
504
|
-
":#{e.name} =>
|
519
|
+
":#{e.name} => merge_template_parameter(#{template_proc(e)}, all_parameters[:#{param_name}]), "
|
505
520
|
else
|
506
|
-
":#{e.name} =>
|
521
|
+
":#{e.name} => merge_block_tag_parameter(#{template_proc(e)}, all_parameters[:#{param_name}]), "
|
507
522
|
end
|
508
523
|
else
|
509
524
|
":#{e.name} => #{template_proc(e)}, "
|
@@ -580,7 +595,7 @@ module Hobo::Dryml
|
|
580
595
|
to_call = if is_param_default_call
|
581
596
|
# The tag is available in a local variable
|
582
597
|
# holding a proc
|
583
|
-
|
598
|
+
name
|
584
599
|
elsif (call_type = polymorphic_call_type(el))
|
585
600
|
"find_polymorphic_tag(:#{name}, #{call_type})"
|
586
601
|
else
|
@@ -644,7 +659,7 @@ module Hobo::Dryml
|
|
644
659
|
else
|
645
660
|
dryml_exception("invalid merge_attrs", el)
|
646
661
|
end
|
647
|
-
"{#{items}}
|
662
|
+
"merge_attrs({#{items}},(#{extra_attributes}) || {})"
|
648
663
|
else
|
649
664
|
"{#{items}}"
|
650
665
|
end
|