Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release. Among other improvements, this means that it now automagically selects between WEBrick and Mongrel. Just run ./instiki --daemon
This commit is contained in:
parent
43aadecc99
commit
4e14ccc74d
893 changed files with 71965 additions and 28511 deletions
|
@ -4,10 +4,6 @@ module ActionView
|
|||
module Renderable #:nodoc:
|
||||
extend ActiveSupport::Memoizable
|
||||
|
||||
def self.included(base)
|
||||
@@mutex = Mutex.new
|
||||
end
|
||||
|
||||
def filename
|
||||
'compiled-template'
|
||||
end
|
||||
|
@ -22,17 +18,17 @@ module ActionView
|
|||
end
|
||||
memoize :compiled_source
|
||||
|
||||
def method_name_without_locals
|
||||
['_run', extension, method_segment].compact.join('_')
|
||||
end
|
||||
memoize :method_name_without_locals
|
||||
|
||||
def render(view, local_assigns = {})
|
||||
compile(local_assigns)
|
||||
|
||||
stack = view.instance_variable_get(:@_render_stack)
|
||||
stack.push(self)
|
||||
|
||||
# This is only used for TestResponse to set rendered_template
|
||||
unless is_a?(InlineTemplate) || view.instance_variable_get(:@_first_render)
|
||||
view.instance_variable_set(:@_first_render, self)
|
||||
end
|
||||
|
||||
view.send(:_evaluate_assigns_and_ivars)
|
||||
view.send(:_set_controller_content_type, mime_type) if respond_to?(:mime_type)
|
||||
|
||||
|
@ -51,9 +47,12 @@ module ActionView
|
|||
|
||||
def method_name(local_assigns)
|
||||
if local_assigns && local_assigns.any?
|
||||
local_assigns_keys = "locals_#{local_assigns.keys.map { |k| k.to_s }.sort.join('_')}"
|
||||
method_name = method_name_without_locals.dup
|
||||
method_name << "_locals_#{local_assigns.keys.map { |k| k.to_s }.sort.join('_')}"
|
||||
else
|
||||
method_name = method_name_without_locals
|
||||
end
|
||||
['_run', extension, method_segment, local_assigns_keys].compact.join('_').to_sym
|
||||
method_name.to_sym
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -61,10 +60,8 @@ module ActionView
|
|||
def compile(local_assigns)
|
||||
render_symbol = method_name(local_assigns)
|
||||
|
||||
@@mutex.synchronize do
|
||||
if recompile?(render_symbol)
|
||||
compile!(render_symbol, local_assigns)
|
||||
end
|
||||
if !Base::CompiledTemplates.method_defined?(render_symbol) || recompile?
|
||||
compile!(render_symbol, local_assigns)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -92,11 +89,8 @@ module ActionView
|
|||
end
|
||||
end
|
||||
|
||||
# Method to check whether template compilation is necessary.
|
||||
# The template will be compiled if the file has not been compiled yet, or
|
||||
# if local_assigns has a new key, which isn't supported by the compiled code yet.
|
||||
def recompile?(symbol)
|
||||
!(ActionView::PathSet::Path.eager_load_templates? && Base::CompiledTemplates.method_defined?(symbol))
|
||||
def recompile?
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue