<br><br><div><span class="gmail_quote">On 6/7/06, <b class="gmail_sendername">Deb Lewis</b> &lt;<a href="mailto:djlewis@acm.org">djlewis@acm.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>



<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">RE; default template src dir</font></span></div></div><div><span class="q">
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">&gt;&gt; <font color="#000000" face="Times New Roman" size="3">if we wanted to so something like app/masterview in the meantime we could 
</font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><font color="#000000" face="Times New Roman" size="3">&gt;&gt; 
since that has the advantage of being the same subdirectory depth as 
app/views.</font></font></span><br></div></span></div><div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>I think I like do like that better than lurking down in 
app/views/masterview, so I'll go ahead and make that change to the default 
config.</span></font></div></div></div></blockquote><div><br>ok. We just need to make sure the generator and watcher are putting things in the right place too. Might search for 'app/views' across the tree to see if it was hard coded anywhere else. Shame on me if I didn't use a constant everywhere. Of course that will all be centralized soon when I get the centralized IO stuff in.
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2">
<span>&gt;&gt; <font color="#000000" face="Times New Roman" size="3">think about ways where they could reuse the custom directives across 
apps...</font></span></font></div></div><div><span class="q">
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>&gt;&gt; <font color="#000000" face="Times New Roman" size="3">want to make sure to have a way for directives to be loaded in other 
directories </font></span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span></span></font>&nbsp;</div></span></div><div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>Yep, and in fact I'll probably do exactly that.&nbsp; 
Just append any ol' path name you want to config.directive_paths in your 
settings.rb or env config.</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span></span></font>&nbsp;</div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>But it would be nice to have a convenient &quot;if you have 
the conventional directives dir in your rails app we'll load it 
automagically&quot;.&nbsp; I'll put in app/masterview/directives for now and 
test-drive it with something to make sure it &quot;feels good&quot; in the overall 
organization of my app.</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span></span></font>&nbsp;</div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>still contemplating your caps plan B fallback for 
import/gen directives - it's a bit grating, I do prefer &quot;{template_path}&quot; over 
&quot;TEMPLATE_PATH&quot;.&nbsp; Making the notation itself configurable seems like a bad 
idea - the basic notation should be simple and standard.</span></font></div></div></div></blockquote><div><br>I see your point. If you like {template_path} better then many other people will too, so I am ok with that. I will have to test but I don't think it will be any problem to use the {} syntax around the keywords.
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2">
<span>Maybe TEMPLATE_SHORT_PATH or 
TEMPLATE_BASE_PATH&nbsp;rather than SHORTNAME?&nbsp; Trying to find the right 
name to fit with &quot;standard&quot; file system terminology and the existing File 
protocol in ruby.&nbsp; File::basename get you just the base file name w/out 
path or extension, so maybe &quot;base path&quot; captures the no-ext 
intent?</span></font></div></div></div></blockquote><div><br>I had a hard time figuring out what to call that. I basically want the relative pathname to the root (app/masterview) without extension. I couldn't think of a good name for it. Looking at the ruby util Pathname it has a function that is close 'relative_path_from'. So {template_path_no_ext} or one of the other ones you mentiond. 
<br><br>I took your advice on the path stuff by not worrying about native file paths and only working with forward slash paths. By doing this Pathname does much of what I needed and the rest was easily added in. So I use extended Pathname for path operations and have the consolidated io to handle the details about where to read and write the files from (file system with this base path, db, hash, ...)
<br><br>I think it is going to turn out nice.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div dir="ltr" align="left">
<font color="#0000ff" face="Arial" size="2"><span>Don't like CONTROLLER and ACTION - that may happen to 
be what those elements of a path represent, but it's not necessarily so.&nbsp; 
And there's potentially diffs in url path fragments vs. controller impl 
structures.&nbsp; So I think the notions we allow to be expressed in the 
keywords we support should be restricted just to the concepts of the template 
file living in some relative scope of the file system structure - thus just 
name, extension, full/relative paths.</span></font></div></div></div></blockquote><div><br><br>Yeah I didn't like that much either, however it is what the standard rails view layout looks like so I was trying to talk in terms that users would understand. You are right in that obviously people don't have to use that convention and can have more levels or other path arrangements.
<br><br>So maybe something like<br><br>{template_full_path}<br>
{template_path}<br>{template_path_no_ext} or *<br>{parent}<br>{filename}<br>{basename}<br>{extension}<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><span class="q"><div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>&gt;&gt; <font color="#000000" face="Times New Roman" size="3">Typically keyword expansion is only needed on generate, gen_* and import* 
commands </font></span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span></span></font><font color="#0000ff" face="Arial" size="2"><span>&gt;&gt; <font color="#000000" face="Times New Roman" size="3">so by having it default to on only for those it doesn't 
affect most other directives.</font></span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span></span></font>&nbsp;</div></span></div><div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial" size="2"><span>Take a stronger point of view: these *are* the only 
directives that this applies to.&nbsp; Let's don't open it to other directives 
until there's a clear need and an understanding of what might be 
appropriate.&nbsp; [don't invent overly general mechanism until we need it - 
YAGNI]</span></font></div></div></div></blockquote><div><br><br>You are probably right. Simpler is better.<br>&nbsp;</div></div>Thanks for the continued refinement and input! It will save much confusion down the road.<br>