seancorfield / org-corfield-cfmx

Automatically exported from code.google.com/p/org-corfield-cfmx
0 stars 0 forks source link

Allow specification of where generated files should go #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From Kurt Bonnet:

VERY COOL!! I have just 1 suggestion: make the physical path to the
directory where the closure files get written a configuration value so it's
easy to have closures "just work" from any level of your file hierarchy.

I modified your ClosureFactor.cfc file as shown below to do this and it's
working.

<cfset variables.baseFilePath = "" /><!--- Base file path to
org/corfield/closure directory NO TRAILING SLASH --->

<cffunction name="init" returntype="org.corfield.closure.ClosureFactory" >
<cfargument name="baseFilePath" type="string" required="true" >

<cfset variables.baseFilePath = arguments.baseFilePath >

<cfreturn this > </cffunction>

(in makeClosureFromString) ..... <!--- synthesize a unique function name:
---> <cfset functionName = "_" & replace(createUUID(),"-","","all") />
<cfset filePath = variables.baseFilePath & "/" & functionName /> <!--- if
the code seems to be script code, wrap it in a cfscript tag: ---> ......

and of course the fall to the ClosureFactory becomes:

<cfset cf = createObject("component",
"org.corfield.closure.ClosureFactory").init( "<<< physical path to
/org/corfield/closure >>>" ) > 

Original issue reported on code.google.com by seancorf...@gmail.com on 10 Oct 2006 at 6:31

GoogleCodeExporter commented 9 years ago
Kurt's code won't quite work - the default base path should be "." not "" but 
overall
it's a good idea. It should use expandPath() so mappings work.

Original comment by seancorf...@gmail.com on 10 Oct 2006 at 6:32

GoogleCodeExporter commented 9 years ago
Updated type/priority.

Original comment by seancorf...@gmail.com on 10 Oct 2006 at 6:35