Skip to content

Commit

Permalink
Updated files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian White committed Mar 3, 2009
1 parent 51cd664 commit 4b50979
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions doc/classes/InheritViews/PathSet.html
Expand Up @@ -76,7 +76,7 @@ <h2>Public instance methods</h2>
<a name='M000013'> </a>
<div class='synopsis'>
<span class='name'>find_parent_template</span>
<span class='arguments'>(template_path, format = nil)</span>
<span class='arguments'>(template_path, format = nil, html_fallback = true)</span>
</div>
<div class='description'>
<p>
Expand All @@ -88,14 +88,14 @@ <h2>Public instance methods</h2>
<a class='source-toggle' href='#' onclick="toggleCode('M000013-source'); return false">
[show source]
</a>
<pre id='M000013-source'><span class="ruby-comment cmt"># File lib/inherit_views.rb, line 108</span>&#x000A; <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_parent_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)&#x000A; <span class="ruby-comment cmt"># first, we grab the inherit view paths that are 'above' the given template_path</span>&#x000A; <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">present?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">starting_path</span> = <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">detect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-node">&quot;#{path}/&quot;</span>)})&#x000A; <span class="ruby-identifier">parent_paths</span> = <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">starting_path</span>)<span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>)&#x000A; <span class="ruby-comment cmt"># then, search through each path, substituting the inherit view path, returning the first found</span>&#x000A; <span class="ruby-identifier">parent_paths</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-keyword kw">begin</span>&#x000A; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">orig_find_template</span>(<span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-node">/^#{starting_path}/</span>, <span class="ruby-identifier">path</span>), <span class="ruby-identifier">format</span>)&#x000A; <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>&#x000A; <span class="ruby-keyword kw">next</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-identifier">raise</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span>)&#x000A; <span class="ruby-keyword kw">end</span></pre>
<pre id='M000013-source'><span class="ruby-comment cmt"># File lib/inherit_views.rb, line 108</span>&#x000A; <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_parent_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">html_fallback</span> = <span class="ruby-keyword kw">true</span>)&#x000A; <span class="ruby-comment cmt"># first, we grab the inherit view paths that are 'above' the given template_path</span>&#x000A; <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">present?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">starting_path</span> = <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">detect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-node">&quot;#{path}/&quot;</span>)})&#x000A; <span class="ruby-identifier">parent_paths</span> = <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">starting_path</span>)<span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>)&#x000A; <span class="ruby-comment cmt"># then, search through each path, substituting the inherit view path, returning the first found</span>&#x000A; <span class="ruby-identifier">parent_paths</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-keyword kw">begin</span>&#x000A; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">orig_find_template</span>(<span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-node">/^#{starting_path}/</span>, <span class="ruby-identifier">path</span>), <span class="ruby-identifier">format</span>, <span class="ruby-identifier">html_fallback</span>)&#x000A; <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>&#x000A; <span class="ruby-keyword kw">next</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-keyword kw">end</span>&#x000A; <span class="ruby-identifier">raise</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span>)&#x000A; <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
<div class='public-instance method' id='method-M000011'>
<a name='M000011'> </a>
<div class='synopsis'>
<span class='name'>find_template</span>
<span class='arguments'>(template_path, format = nil)</span>
<span class='arguments'>(template_path, format = nil, html_fallback = true)</span>
</div>
<div class='description'>
<p>
Expand All @@ -106,14 +106,14 @@ <h2>Public instance methods</h2>
<a class='source-toggle' href='#' onclick="toggleCode('M000011-source'); return false">
[show source]
</a>
<pre id='M000011-source'><span class="ruby-comment cmt"># File lib/inherit_views.rb, line 101</span>&#x000A; <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)&#x000A; <span class="ruby-keyword kw">super</span>&#x000A; <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>&#x000A; <span class="ruby-identifier">find_parent_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span>)&#x000A; <span class="ruby-keyword kw">end</span></pre>
<pre id='M000011-source'><span class="ruby-comment cmt"># File lib/inherit_views.rb, line 101</span>&#x000A; <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">html_fallback</span> = <span class="ruby-keyword kw">true</span>)&#x000A; <span class="ruby-keyword kw">super</span>&#x000A; <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span>&#x000A; <span class="ruby-identifier">find_parent_template</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span>)&#x000A; <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
<div class='public-instance method' id='method-M000012'>
<a name='M000012'> </a>
<div class='synopsis'>
<span class='name'>orig_find_template</span>
<span class='arguments'>(template_path, format = nil)</span>
<span class='arguments'>(template_path, format = nil, html_fallback = true)</span>
</div>
<div class='description'>
<p>
Expand Down
2 changes: 1 addition & 1 deletion doc/created.rid
@@ -1 +1 @@
Fri, 27 Feb 2009 10:55:52 +0000
Tue, 03 Mar 2009 09:39:28 +0000
2 changes: 1 addition & 1 deletion doc/files/lib/inherit_views_rb.html
Expand Up @@ -31,7 +31,7 @@ <h1 class='name'>inherit_views.rb</h1>
</div>
<div class='last-update'>
Last Update:
<span class='datetime'>Tue Feb 24 08:54:23 +0000 2009</span>
<span class='datetime'>Tue Mar 03 09:37:47 +0000 2009</span>
</div>
</div>
<div id='content'>
Expand Down

0 comments on commit 4b50979

Please sign in to comment.