Skip to content

Instantly share code, notes, and snippets.

@rip747
Created July 31, 2011 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rip747/1116619 to your computer and use it in GitHub Desktop.
Save rip747/1116619 to your computer and use it in GitHub Desktop.
cfwheels api doc generation... idea
<cfcomponent extends="Controller">
<cffunction name="index">
<cfsetting showdebugoutput="false">
<cfset releasesDir ="#get('rootpath')##get('filePath')#/releases">
<cfdirectory action="list" directory="#expandPath(releasesDir)#" filter="*.zip" name="releases">
<cfloop query="releases">
<cfset version = ListToArray(name, ".")>
<cfset ArrayDeleteAt(version, 1)>
<cfset ArrayDeleteAt(version, ArrayLen(version))>
<cfset version = ArrayToList(version, ".")>
<!--- can't have "." in directory --->
<cfset versionDashed = ReplaceNoCase(version, ".", "-", "all")>
<cfset unZipDir = ListAppend(releasesDir, versionDashed, "/")>
<cfset zipfile = ListAppend(releasesDir, name, "/")>
<cfset wheelsDir = ListAppend(unZipDir, "wheels", "/")>
<cfset wheelsComponentPath = ListAppend(ListChangeDelims(unZipDir, "/", "."), "wheels", ".")>
<cfset loc.function = model("function")>
<cfzip action="unzip" destination="#expandPath(unZipDir)#" file="#expandPath(zipfile)#" overwrite="true">
<cfdirectory action="list" directory="#expandPath(wheelsDir)#" name="components" filter="*.cfc">
<cfloop query="components">
<cfset objName = ListFirst(name, '.')>
<cfif !ListFindNoCase("connection,test", objName)>
<cfset obj = createobject("component", "#wheelsComponentPath#.#objName#")>
<cfset loc.function.generateFunctionsFromScope(obj, version)>
</cfif>
</cfloop>
</cfloop>
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment