doc/TaskJuggler/Tj3Daemon.html in taskjuggler-0.0.8 vs doc/TaskJuggler/Tj3Daemon.html in taskjuggler-0.0.9

- old
+ new

@@ -133,10 +133,12 @@ <li><a href="../TaskJuggler/AttributeBase.html">TaskJuggler::AttributeBase</a></li> <li><a href="../TaskJuggler/AttributeDefinition.html">TaskJuggler::AttributeDefinition</a></li> + <li><a href="../TaskJuggler/AttributeOverwrite.html">TaskJuggler::AttributeOverwrite</a></li> + <li><a href="../TaskJuggler/BatchProcessor.html">TaskJuggler::BatchProcessor</a></li> <li><a href="../TaskJuggler/Booking.html">TaskJuggler::Booking</a></li> <li><a href="../TaskJuggler/BookingListAttribute.html">TaskJuggler::BookingListAttribute</a></li> @@ -211,10 +213,12 @@ <li><a href="../TaskJuggler/HTMLGraphics.html">TaskJuggler::HTMLGraphics</a></li> <li><a href="../TaskJuggler/Interval.html">TaskJuggler::Interval</a></li> + <li><a href="../TaskJuggler/IntervalList.html">TaskJuggler::IntervalList</a></li> + <li><a href="../TaskJuggler/IntervalListAttribute.html">TaskJuggler::IntervalListAttribute</a></li> <li><a href="../TaskJuggler/JobInfo.html">TaskJuggler::JobInfo</a></li> <li><a href="../TaskJuggler/Journal.html">TaskJuggler::Journal</a></li> @@ -243,10 +247,12 @@ <li><a href="../TaskJuggler/LogicalExpression.html">TaskJuggler::LogicalExpression</a></li> <li><a href="../TaskJuggler/LogicalExpressionAttribute.html">TaskJuggler::LogicalExpressionAttribute</a></li> + <li><a href="../TaskJuggler/LogicalExpressionListAttribute.html">TaskJuggler::LogicalExpressionListAttribute</a></li> + <li><a href="../TaskJuggler/LogicalFlag.html">TaskJuggler::LogicalFlag</a></li> <li><a href="../TaskJuggler/LogicalFunction.html">TaskJuggler::LogicalFunction</a></li> <li><a href="../TaskJuggler/LogicalOperation.html">TaskJuggler::LogicalOperation</a></li> @@ -523,10 +529,12 @@ <li><a href="../TaskJuggler/VimSyntax.html">TaskJuggler::VimSyntax</a></li> <li><a href="../TaskJuggler/WebServer.html">TaskJuggler::WebServer</a></li> + <li><a href="../TaskJuggler/WelcomePage.html">TaskJuggler::WelcomePage</a></li> + <li><a href="../TaskJuggler/WorkingHours.html">TaskJuggler::WorkingHours</a></li> <li><a href="../TaskJuggler/WorkingHoursAttribute.html">TaskJuggler::WorkingHoursAttribute</a></li> <li><a href="../TaskJuggler/XMLBlob.html">TaskJuggler::XMLBlob</a></li> @@ -549,12 +557,10 @@ <li><a href="../RuntimeConfig.html">RuntimeConfig</a></li> <li><a href="../String.html">String</a></li> - <li><a href="../StringIO.html">StringIO</a></li> - </ul> <div id="no-class-search-results" style="display: none;">No matching classes.</div> </div> @@ -598,24 +604,24 @@ <div class="method-source-code" id="new-source"> <pre> - <span class="ruby-comment cmt"># File lib/tj3d.rb, line 25</span> -25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> -26: <span class="ruby-keyword kw">super</span> -27: <span class="ruby-ivar">@mandatoryArgs</span> = <span class="ruby-value str">'[&lt;tjp file&gt; [&lt;tji file&gt; ...] ...]'</span> -28: -29: <span class="ruby-ivar">@log</span> = <span class="ruby-constant">LogFile</span>.<span class="ruby-identifier">instance</span> -30: <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">logFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>, <span class="ruby-node">&quot;/#{AppConfig.appName}.log&quot;</span>) -31: <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">appName</span> = <span class="ruby-constant">AppConfig</span>.<span class="ruby-identifier">appName</span> -32: <span class="ruby-ivar">@daemonize</span> = <span class="ruby-keyword kw">true</span> -33: <span class="ruby-ivar">@uriFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>, <span class="ruby-value str">'.tj3d.uri'</span>) -34: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span> -35: <span class="ruby-ivar">@webServer</span> = <span class="ruby-keyword kw">false</span> -36: <span class="ruby-ivar">@webServerPort</span> = <span class="ruby-keyword kw">nil</span> -37: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/tj3d.rb, line 26</span> +26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> +27: <span class="ruby-keyword kw">super</span> +28: <span class="ruby-ivar">@mandatoryArgs</span> = <span class="ruby-value str">'[&lt;tjp file&gt; [&lt;tji file&gt; ...] ...]'</span> +29: +30: <span class="ruby-ivar">@log</span> = <span class="ruby-constant">LogFile</span>.<span class="ruby-identifier">instance</span> +31: <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">logFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>, <span class="ruby-node">&quot;/#{AppConfig.appName}.log&quot;</span>) +32: <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">appName</span> = <span class="ruby-constant">AppConfig</span>.<span class="ruby-identifier">appName</span> +33: <span class="ruby-ivar">@daemonize</span> = <span class="ruby-keyword kw">true</span> +34: <span class="ruby-ivar">@uriFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>, <span class="ruby-value str">'.tj3d.uri'</span>) +35: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span> +36: <span class="ruby-ivar">@webServer</span> = <span class="ruby-keyword kw">false</span> +37: <span class="ruby-ivar">@webServerPort</span> = <span class="ruby-keyword kw">nil</span> +38: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -648,15 +654,15 @@ <div class="method-source-code" id="error-source"> <pre> - <span class="ruby-comment cmt"># File lib/tj3d.rb, line 94</span> -94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">message</span>) -95: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ERROR: #{message}&quot;</span> -96: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> -97: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/tj3d.rb, line 98</span> + 98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">message</span>) + 99: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ERROR: #{message}&quot;</span> +100: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> +101: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -683,30 +689,33 @@ <div class="method-source-code" id="main-source"> <pre> - <span class="ruby-comment cmt"># File lib/tj3d.rb, line 74</span> -74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> -75: <span class="ruby-identifier">files</span> = <span class="ruby-keyword kw">super</span> -76: <span class="ruby-identifier">broker</span> = <span class="ruby-constant">ProjectBroker</span>.<span class="ruby-identifier">new</span> -77: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-value str">'global'</span>) -78: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-ivar">@log</span>, <span class="ruby-value str">'global.log'</span>) -79: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">broker</span>, <span class="ruby-value str">'global'</span>) -80: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">broker</span>, <span class="ruby-value str">'daemon'</span>) -81: -82: <span class="ruby-comment cmt"># Set some config variables if corresponding data was provided via the</span> -83: <span class="ruby-comment cmt"># command line.</span> -84: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">port</span> = <span class="ruby-ivar">@port</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> -85: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">uriFile</span> = <span class="ruby-ivar">@uriFile</span>.<span class="ruby-identifier">untaint</span> -86: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">enableWebServer</span> = <span class="ruby-ivar">@webServer</span> -87: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">webServerPort</span> = <span class="ruby-ivar">@webServerPort</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@webServerPort</span> -88: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">projectFiles</span> = <span class="ruby-identifier">sortInputFiles</span>(<span class="ruby-identifier">files</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">files</span>.<span class="ruby-identifier">empty?</span> -89: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">daemonize</span> = <span class="ruby-ivar">@daemonize</span> -90: -91: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">start</span> -92: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/tj3d.rb, line 75</span> +75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> +76: <span class="ruby-identifier">files</span> = <span class="ruby-keyword kw">super</span> +77: <span class="ruby-identifier">broker</span> = <span class="ruby-constant">ProjectBroker</span>.<span class="ruby-identifier">new</span> +78: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-value str">'global'</span>) +79: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-ivar">@log</span>, <span class="ruby-value str">'global.log'</span>) +80: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">broker</span>, <span class="ruby-value str">'global'</span>) +81: <span class="ruby-ivar">@rc</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">broker</span>, <span class="ruby-value str">'daemon'</span>) +82: +83: <span class="ruby-comment cmt"># Set some config variables if corresponding data was provided via the</span> +84: <span class="ruby-comment cmt"># command line.</span> +85: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">port</span> = <span class="ruby-ivar">@port</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> +86: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">uriFile</span> = <span class="ruby-ivar">@uriFile</span>.<span class="ruby-identifier">untaint</span> +87: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">enableWebServer</span> = <span class="ruby-ivar">@webServer</span> +88: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">webServerPort</span> = <span class="ruby-ivar">@webServerPort</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@webServerPort</span> +89: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">projectFiles</span> = <span class="ruby-identifier">sortInputFiles</span>(<span class="ruby-identifier">files</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">files</span>.<span class="ruby-identifier">empty?</span> +90: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">daemonize</span> = <span class="ruby-ivar">@daemonize</span> +91: <span class="ruby-comment cmt"># Create log files for standard IO for each child process if the daemon</span> +92: <span class="ruby-comment cmt"># is not disconnected from the terminal.</span> +93: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">logStdIO</span> = <span class="ruby-operator">!</span><span class="ruby-ivar">@daemonize</span> +94: +95: <span class="ruby-identifier">broker</span>.<span class="ruby-identifier">start</span> +96: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -733,41 +742,41 @@ <div class="method-source-code" id="process-rguments-source"> <pre> - <span class="ruby-comment cmt"># File lib/tj3d.rb, line 39</span> -39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">processArguments</span>(<span class="ruby-identifier">argv</span>) -40: <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">do</span> -41: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">banner</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">The TaskJuggler daemon can be used to quickly generate reports for a numberof scheduled projects that are resident in memory. Once the daemon has beenstarted tj3client can be used to control it.</span> -42: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-d'</span>, <span class="ruby-value str">'--dont-daemonize'</span>, -43: <span class="ruby-identifier">format</span>(<span class="ruby-value str">&quot;Don't put program into daemon mode. Keep it &quot;</span> <span class="ruby-operator">+</span> -44: <span class="ruby-value str">'connected to the terminal and show debug output.'</span>)) <span class="ruby-keyword kw">do</span> -45: <span class="ruby-ivar">@daemonize</span> = <span class="ruby-keyword kw">false</span> -46: <span class="ruby-keyword kw">end</span> -47: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--port &lt;NUMBER&gt;'</span>, <span class="ruby-constant">Integer</span>, -48: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Use the specified TCP/IP port to serve tj3client '</span> <span class="ruby-operator">+</span> -49: <span class="ruby-value str">'requests (Default: 8474).'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> -50: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">arg</span> -51: <span class="ruby-keyword kw">end</span> -52: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--urifile'</span>, <span class="ruby-constant">String</span>, -53: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'If the port is 0, use this file to store the URI '</span> <span class="ruby-operator">+</span> -54: <span class="ruby-value str">'of the server.'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> -55: <span class="ruby-ivar">@uriFile</span> = <span class="ruby-identifier">arg</span> -56: <span class="ruby-keyword kw">end</span> -57: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-w'</span>, <span class="ruby-value str">'--webserver'</span>, -58: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Start a web server that serves the reports of '</span> <span class="ruby-operator">+</span> -59: <span class="ruby-value str">'the loaded projects.'</span>)) <span class="ruby-keyword kw">do</span> -60: <span class="ruby-ivar">@webServer</span> = <span class="ruby-keyword kw">true</span> -61: <span class="ruby-keyword kw">end</span> -62: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--webserver-port &lt;NUMBER&gt;'</span>, <span class="ruby-constant">Integer</span>, -63: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Use the specified TCP/IP port to serve web browser '</span> <span class="ruby-operator">+</span> -64: <span class="ruby-value str">'requests (Default: 8080).'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> -65: <span class="ruby-ivar">@webServerPort</span> = <span class="ruby-identifier">arg</span> -66: <span class="ruby-keyword kw">end</span> -67: <span class="ruby-keyword kw">end</span> -68: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/tj3d.rb, line 40</span> +40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">processArguments</span>(<span class="ruby-identifier">argv</span>) +41: <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">do</span> +42: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">banner</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">The TaskJuggler daemon can be used to quickly generate reports for a numberof scheduled projects that are resident in memory. Once the daemon has beenstarted tj3client can be used to control it.</span> +43: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-d'</span>, <span class="ruby-value str">'--dont-daemonize'</span>, +44: <span class="ruby-identifier">format</span>(<span class="ruby-value str">&quot;Don't put program into daemon mode. Keep it &quot;</span> <span class="ruby-operator">+</span> +45: <span class="ruby-value str">'connected to the terminal and show debug output.'</span>)) <span class="ruby-keyword kw">do</span> +46: <span class="ruby-ivar">@daemonize</span> = <span class="ruby-keyword kw">false</span> +47: <span class="ruby-keyword kw">end</span> +48: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--port &lt;NUMBER&gt;'</span>, <span class="ruby-constant">Integer</span>, +49: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Use the specified TCP/IP port to serve tj3client '</span> <span class="ruby-operator">+</span> +50: <span class="ruby-value str">'requests (Default: 8474).'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> +51: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">arg</span> +52: <span class="ruby-keyword kw">end</span> +53: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--urifile'</span>, <span class="ruby-constant">String</span>, +54: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'If the port is 0, use this file to store the URI '</span> <span class="ruby-operator">+</span> +55: <span class="ruby-value str">'of the server.'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> +56: <span class="ruby-ivar">@uriFile</span> = <span class="ruby-identifier">arg</span> +57: <span class="ruby-keyword kw">end</span> +58: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-w'</span>, <span class="ruby-value str">'--webserver'</span>, +59: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Start a web server that serves the reports of '</span> <span class="ruby-operator">+</span> +60: <span class="ruby-value str">'the loaded projects.'</span>)) <span class="ruby-keyword kw">do</span> +61: <span class="ruby-ivar">@webServer</span> = <span class="ruby-keyword kw">true</span> +62: <span class="ruby-keyword kw">end</span> +63: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--webserver-port &lt;NUMBER&gt;'</span>, <span class="ruby-constant">Integer</span>, +64: <span class="ruby-identifier">format</span>(<span class="ruby-value str">'Use the specified TCP/IP port to serve web browser '</span> <span class="ruby-operator">+</span> +65: <span class="ruby-value str">'requests (Default: 8080).'</span>)) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> +66: <span class="ruby-ivar">@webServerPort</span> = <span class="ruby-identifier">arg</span> +67: <span class="ruby-keyword kw">end</span> +68: <span class="ruby-keyword kw">end</span> +69: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -805,44 +814,44 @@ <div class="method-source-code" id="sort-nput-iles-source"> <pre> - <span class="ruby-comment cmt"># File lib/tj3d.rb, line 105</span> -105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortInputFiles</span>(<span class="ruby-identifier">files</span>) -106: <span class="ruby-identifier">projects</span> = [] -107: <span class="ruby-identifier">project</span> = <span class="ruby-keyword kw">nil</span> -108: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> -109: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">4</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'.tjp'</span> -110: <span class="ruby-comment cmt"># The project master file determines the working directory. If it's</span> -111: <span class="ruby-comment cmt"># an absolute file name, that directory will become the working</span> -112: <span class="ruby-comment cmt"># directory. If it's a relative file name, the current working</span> -113: <span class="ruby-comment cmt"># directory will be kept.</span> -114: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span> -115: <span class="ruby-comment cmt"># Absolute file name</span> -116: <span class="ruby-identifier">workingDir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>) -117: <span class="ruby-identifier">fileName</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>) -118: <span class="ruby-keyword kw">else</span> -119: <span class="ruby-comment cmt"># Relative file name</span> -120: <span class="ruby-identifier">workingDir</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span> -121: <span class="ruby-identifier">fileName</span> = <span class="ruby-identifier">file</span> -122: <span class="ruby-keyword kw">end</span> -123: <span class="ruby-identifier">project</span> = [ <span class="ruby-identifier">workingDir</span>, <span class="ruby-identifier">fileName</span> ] -124: <span class="ruby-identifier">projects</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">project</span> -125: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">4</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'.tji'</span> -126: <span class="ruby-comment cmt"># .tji files are optional. But if they are specified, they must</span> -127: <span class="ruby-comment cmt"># always follow the master file in the list.</span> -128: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">nil?</span> -129: <span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;You must specify a '.tjp' file before the '.tji' files&quot;</span>) -130: <span class="ruby-keyword kw">end</span> -131: <span class="ruby-identifier">project</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span> -132: <span class="ruby-keyword kw">else</span> -133: <span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Project files must have a '.tjp' or '.tji' extension&quot;</span>) -134: <span class="ruby-keyword kw">end</span> -135: <span class="ruby-keyword kw">end</span> -136: -137: <span class="ruby-identifier">projects</span> -138: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/tj3d.rb, line 109</span> +109: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortInputFiles</span>(<span class="ruby-identifier">files</span>) +110: <span class="ruby-identifier">projects</span> = [] +111: <span class="ruby-identifier">project</span> = <span class="ruby-keyword kw">nil</span> +112: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> +113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">4</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'.tjp'</span> +114: <span class="ruby-comment cmt"># The project master file determines the working directory. If it's</span> +115: <span class="ruby-comment cmt"># an absolute file name, that directory will become the working</span> +116: <span class="ruby-comment cmt"># directory. If it's a relative file name, the current working</span> +117: <span class="ruby-comment cmt"># directory will be kept.</span> +118: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span> +119: <span class="ruby-comment cmt"># Absolute file name</span> +120: <span class="ruby-identifier">workingDir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>) +121: <span class="ruby-identifier">fileName</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>) +122: <span class="ruby-keyword kw">else</span> +123: <span class="ruby-comment cmt"># Relative file name</span> +124: <span class="ruby-identifier">workingDir</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span> +125: <span class="ruby-identifier">fileName</span> = <span class="ruby-identifier">file</span> +126: <span class="ruby-keyword kw">end</span> +127: <span class="ruby-identifier">project</span> = [ <span class="ruby-identifier">workingDir</span>, <span class="ruby-identifier">fileName</span> ] +128: <span class="ruby-identifier">projects</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">project</span> +129: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">file</span>[<span class="ruby-value">4</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'.tji'</span> +130: <span class="ruby-comment cmt"># .tji files are optional. But if they are specified, they must</span> +131: <span class="ruby-comment cmt"># always follow the master file in the list.</span> +132: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">nil?</span> +133: <span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;You must specify a '.tjp' file before the '.tji' files&quot;</span>) +134: <span class="ruby-keyword kw">end</span> +135: <span class="ruby-identifier">project</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span> +136: <span class="ruby-keyword kw">else</span> +137: <span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Project files must have a '.tjp' or '.tji' extension&quot;</span>) +138: <span class="ruby-keyword kw">end</span> +139: <span class="ruby-keyword kw">end</span> +140: +141: <span class="ruby-identifier">projects</span> +142: <span class="ruby-keyword kw">end</span></pre> </div> </div>