taskjuggler 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. data/CHANGELOG +119 -0
  2. data/benchmarks/allocatedSlots.tjp +1602 -0
  3. data/benchmarks/booking.tjp +40 -30
  4. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/css/tjmanual.css +0 -0
  5. data/{test/TestSuite/Scheduler/Correct → benchmarks}/css/tjreport.css +1 -0
  6. data/benchmarks/gantt.tjp +57 -0
  7. data/benchmarks/htmltaskreport.tjp +26 -1
  8. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/details.png +0 -0
  9. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-green.png +0 -0
  10. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-red.png +0 -0
  11. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-yellow.png +0 -0
  12. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resource.png +0 -0
  13. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resourcegroup.png +0 -0
  14. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/task.png +0 -0
  15. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/taskgroup.png +0 -0
  16. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-down.png +0 -0
  17. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-flat.png +0 -0
  18. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-up.png +0 -0
  19. data/benchmarks/profile.clt +36082 -0
  20. data/benchmarks/profile.html +58182 -0
  21. data/benchmarks/runbench.rb +6 -0
  22. data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/scripts/wz_tooltip.js +0 -0
  23. data/doc/AppConfig.html +85 -37
  24. data/doc/Arguments.html +11 -1
  25. data/doc/CHANGELOG.html +131 -2
  26. data/doc/COPYING.html +11 -1
  27. data/doc/Object.html +12 -3
  28. data/doc/README.html +11 -1
  29. data/doc/RuntimeConfig.html +11 -1
  30. data/doc/String.html +11 -1
  31. data/doc/StringIO.html +11 -1
  32. data/doc/TaskJuggler.html +250 -219
  33. data/doc/TaskJuggler/Account.html +11 -1
  34. data/doc/TaskJuggler/AccountAttribute.html +11 -1
  35. data/doc/TaskJuggler/AccountScenario.html +11 -1
  36. data/doc/TaskJuggler/Allocation.html +11 -1
  37. data/doc/TaskJuggler/AllocationAttribute.html +11 -1
  38. data/doc/TaskJuggler/AttributeBase.html +11 -1
  39. data/doc/TaskJuggler/AttributeDefinition.html +11 -1
  40. data/doc/TaskJuggler/BatchProcessor.html +11 -1
  41. data/doc/TaskJuggler/Booking.html +11 -1
  42. data/doc/TaskJuggler/BookingListAttribute.html +11 -1
  43. data/doc/TaskJuggler/BooleanAttribute.html +11 -1
  44. data/doc/TaskJuggler/CSVFile.html +12 -2
  45. data/doc/TaskJuggler/CellSettingPattern.html +11 -1
  46. data/doc/TaskJuggler/CellSettingPatternList.html +11 -1
  47. data/doc/TaskJuggler/Charge.html +11 -1
  48. data/doc/TaskJuggler/ChargeListAttribute.html +11 -1
  49. data/doc/TaskJuggler/ChargeSet.html +11 -1
  50. data/doc/TaskJuggler/ChargeSetListAttribute.html +11 -1
  51. data/doc/TaskJuggler/CollisionDetector.html +1063 -0
  52. data/doc/TaskJuggler/ColumnListAttribute.html +11 -1
  53. data/doc/TaskJuggler/ColumnTable.html +11 -1
  54. data/doc/TaskJuggler/Daemon.html +11 -1
  55. data/doc/TaskJuggler/{OnShiftCache.html → DataCache.html} +127 -139
  56. data/doc/TaskJuggler/DataCacheEntry.html +711 -0
  57. data/doc/TaskJuggler/DateAttribute.html +11 -1
  58. data/doc/TaskJuggler/DefinitionListAttribute.html +11 -1
  59. data/doc/TaskJuggler/DependencyListAttribute.html +11 -1
  60. data/doc/TaskJuggler/DurationAttribute.html +16 -5
  61. data/doc/TaskJuggler/FileList.html +11 -1
  62. data/doc/TaskJuggler/FileRecord.html +11 -1
  63. data/doc/TaskJuggler/FixnumAttribute.html +19 -9
  64. data/doc/TaskJuggler/FlagListAttribute.html +29 -19
  65. data/doc/TaskJuggler/FloatAttribute.html +23 -13
  66. data/doc/TaskJuggler/FormatListAttribute.html +19 -9
  67. data/doc/TaskJuggler/GanttChart.html +94 -133
  68. data/doc/TaskJuggler/GanttContainer.html +11 -1
  69. data/doc/TaskJuggler/GanttHeader.html +11 -1
  70. data/doc/TaskJuggler/GanttHeaderScaleItem.html +11 -1
  71. data/doc/TaskJuggler/GanttLine.html +11 -1
  72. data/doc/TaskJuggler/GanttLoadStack.html +11 -1
  73. data/doc/TaskJuggler/GanttMilestone.html +11 -1
  74. data/doc/TaskJuggler/GanttRouter.html +247 -596
  75. data/doc/TaskJuggler/GanttTaskBar.html +11 -1
  76. data/doc/TaskJuggler/HTMLDocument.html +11 -1
  77. data/doc/TaskJuggler/HTMLGraphics.html +11 -1
  78. data/doc/TaskJuggler/Interval.html +11 -1
  79. data/doc/TaskJuggler/IntervalListAttribute.html +33 -23
  80. data/doc/TaskJuggler/JobInfo.html +11 -1
  81. data/doc/TaskJuggler/Journal.html +11 -1
  82. data/doc/TaskJuggler/JournalEntry.html +11 -1
  83. data/doc/TaskJuggler/JournalEntryList.html +11 -1
  84. data/doc/TaskJuggler/KeywordArray.html +11 -1
  85. data/doc/TaskJuggler/KeywordDocumentation.html +16 -6
  86. data/doc/TaskJuggler/Limits.html +11 -1
  87. data/doc/TaskJuggler/Limits/Limit.html +11 -1
  88. data/doc/TaskJuggler/LimitsAttribute.html +24 -14
  89. data/doc/TaskJuggler/ListAttributeBase.html +11 -1
  90. data/doc/TaskJuggler/Log.html +11 -1
  91. data/doc/TaskJuggler/LogFile.html +11 -1
  92. data/doc/TaskJuggler/LogicalAttribute.html +11 -1
  93. data/doc/TaskJuggler/LogicalExpression.html +11 -1
  94. data/doc/TaskJuggler/LogicalExpressionAttribute.html +19 -9
  95. data/doc/TaskJuggler/LogicalFlag.html +11 -1
  96. data/doc/TaskJuggler/LogicalFunction.html +11 -1
  97. data/doc/TaskJuggler/LogicalOperation.html +11 -1
  98. data/doc/TaskJuggler/Macro.html +11 -1
  99. data/doc/TaskJuggler/MacroTable.html +11 -1
  100. data/doc/TaskJuggler/ManagerResponsibilities.html +11 -1
  101. data/doc/TaskJuggler/ManagerStatusRecord.html +11 -1
  102. data/doc/TaskJuggler/Message.html +11 -1
  103. data/doc/TaskJuggler/MessageHandler.html +11 -1
  104. data/doc/TaskJuggler/Navigator.html +12 -2
  105. data/doc/TaskJuggler/NavigatorElement.html +11 -1
  106. data/doc/TaskJuggler/NikuProject.html +11 -1
  107. data/doc/TaskJuggler/NikuReport.html +11 -1
  108. data/doc/TaskJuggler/NikuResource.html +11 -1
  109. data/doc/TaskJuggler/NodeListAttribute.html +17 -7
  110. data/doc/TaskJuggler/PlaceHolderCell.html +722 -0
  111. data/doc/TaskJuggler/ProcessIntercom.html +11 -1
  112. data/doc/TaskJuggler/ProcessIntercomIface.html +11 -1
  113. data/doc/TaskJuggler/Project.html +587 -500
  114. data/doc/TaskJuggler/ProjectBroker.html +11 -1
  115. data/doc/TaskJuggler/ProjectBrokerIface.html +11 -1
  116. data/doc/TaskJuggler/ProjectFileParser.html +205 -192
  117. data/doc/TaskJuggler/ProjectFileScanner.html +230 -207
  118. data/doc/TaskJuggler/ProjectRecord.html +11 -1
  119. data/doc/TaskJuggler/ProjectServer.html +11 -1
  120. data/doc/TaskJuggler/ProjectServerIface.html +11 -1
  121. data/doc/TaskJuggler/PropertyAttribute.html +19 -9
  122. data/doc/TaskJuggler/PropertyList.html +95 -83
  123. data/doc/TaskJuggler/PropertySet.html +11 -1
  124. data/doc/TaskJuggler/PropertyTreeNode.html +11 -1
  125. data/doc/TaskJuggler/Query.html +234 -232
  126. data/doc/TaskJuggler/RTFHandlers.html +11 -1
  127. data/doc/TaskJuggler/RTFNavigator.html +11 -1
  128. data/doc/TaskJuggler/RTFQuery.html +11 -1
  129. data/doc/TaskJuggler/RTFReport.html +11 -1
  130. data/doc/TaskJuggler/RTFReportLink.html +11 -1
  131. data/doc/TaskJuggler/RTFWithQuerySupport.html +11 -1
  132. data/doc/TaskJuggler/RealFormat.html +12 -2
  133. data/doc/TaskJuggler/RealFormatAttribute.html +15 -5
  134. data/doc/TaskJuggler/ReferenceAttribute.html +38 -28
  135. data/doc/TaskJuggler/Report.html +96 -113
  136. data/doc/TaskJuggler/ReportBase.html +161 -152
  137. data/doc/TaskJuggler/ReportContext.html +11 -1
  138. data/doc/TaskJuggler/ReportServer.html +59 -48
  139. data/doc/TaskJuggler/ReportServerIface.html +51 -41
  140. data/doc/TaskJuggler/ReportServerRecord.html +11 -1
  141. data/doc/TaskJuggler/ReportServlet.html +11 -1
  142. data/doc/TaskJuggler/ReportTable.html +46 -25
  143. data/doc/TaskJuggler/ReportTableCell.html +296 -275
  144. data/doc/TaskJuggler/ReportTableColumn.html +14 -4
  145. data/doc/TaskJuggler/ReportTableLegend.html +11 -1
  146. data/doc/TaskJuggler/ReportTableLine.html +19 -7
  147. data/doc/TaskJuggler/Resource.html +12 -2
  148. data/doc/TaskJuggler/ResourceListAttribute.html +40 -30
  149. data/doc/TaskJuggler/ResourceListRE.html +11 -1
  150. data/doc/TaskJuggler/ResourceScenario.html +708 -565
  151. data/doc/TaskJuggler/RichText.html +54 -36
  152. data/doc/TaskJuggler/RichTextAttribute.html +31 -21
  153. data/doc/TaskJuggler/RichTextDocument.html +11 -1
  154. data/doc/TaskJuggler/RichTextElement.html +11 -1
  155. data/doc/TaskJuggler/RichTextFunctionExample.html +11 -1
  156. data/doc/TaskJuggler/RichTextFunctionHandler.html +11 -1
  157. data/doc/TaskJuggler/RichTextImage.html +11 -1
  158. data/doc/TaskJuggler/RichTextIntermediate.html +81 -71
  159. data/doc/TaskJuggler/RichTextParser.html +88 -33
  160. data/doc/TaskJuggler/RichTextScanner.html +45 -35
  161. data/doc/TaskJuggler/RichTextSnip.html +11 -1
  162. data/doc/TaskJuggler/RichTextSyntaxRules.html +436 -389
  163. data/doc/TaskJuggler/Scenario.html +11 -1
  164. data/doc/TaskJuggler/ScenarioData.html +11 -1
  165. data/doc/TaskJuggler/ScenarioListAttribute.html +23 -13
  166. data/doc/TaskJuggler/Scoreboard.html +92 -73
  167. data/doc/TaskJuggler/SheetHandlerBase.html +11 -1
  168. data/doc/TaskJuggler/SheetReceiver.html +11 -1
  169. data/doc/TaskJuggler/SheetSender.html +11 -1
  170. data/doc/TaskJuggler/Shift.html +11 -1
  171. data/doc/TaskJuggler/ShiftAssignment.html +11 -1
  172. data/doc/TaskJuggler/ShiftAssignments.html +11 -1
  173. data/doc/TaskJuggler/ShiftAssignmentsAttribute.html +24 -14
  174. data/doc/TaskJuggler/ShiftScenario.html +11 -1
  175. data/doc/TaskJuggler/SimpleQueryExpander.html +11 -1
  176. data/doc/TaskJuggler/SortListAttribute.html +21 -11
  177. data/doc/TaskJuggler/SourceFileInfo.html +11 -1
  178. data/doc/TaskJuggler/StatusSheetReceiver.html +11 -1
  179. data/doc/TaskJuggler/StatusSheetReport.html +11 -1
  180. data/doc/TaskJuggler/StatusSheetSender.html +112 -11
  181. data/doc/TaskJuggler/StringAttribute.html +23 -13
  182. data/doc/TaskJuggler/SymbolAttribute.html +19 -9
  183. data/doc/TaskJuggler/SyntaxReference.html +80 -71
  184. data/doc/TaskJuggler/TOCEntry.html +11 -1
  185. data/doc/TaskJuggler/TSResourceRecord.html +11 -1
  186. data/doc/TaskJuggler/TSTaskRecord.html +11 -1
  187. data/doc/TaskJuggler/TableColumnDefinition.html +11 -1
  188. data/doc/TaskJuggler/TableOfContents.html +11 -1
  189. data/doc/TaskJuggler/TableReport.html +422 -411
  190. data/doc/TaskJuggler/Task.html +11 -1
  191. data/doc/TaskJuggler/TaskDependency.html +11 -1
  192. data/doc/TaskJuggler/TaskListAttribute.html +33 -23
  193. data/doc/TaskJuggler/TaskListRE.html +11 -1
  194. data/doc/TaskJuggler/TaskScenario.html +2007 -1919
  195. data/doc/TaskJuggler/TextFormatter.html +11 -1
  196. data/doc/TaskJuggler/TextParser.html +421 -612
  197. data/doc/TaskJuggler/TextParser/Pattern.html +410 -211
  198. data/doc/TaskJuggler/TextParser/Rule.html +224 -152
  199. data/doc/TaskJuggler/TextParser/StackElement.html +190 -28
  200. data/doc/TaskJuggler/TextParser/State.html +989 -0
  201. data/doc/TaskJuggler/TextParser/StateTransition.html +782 -0
  202. data/doc/TaskJuggler/TextParser/TextParserResultArray.html +25 -14
  203. data/doc/TaskJuggler/TextParser/TokenDoc.html +11 -1
  204. data/doc/TaskJuggler/TextReport.html +11 -1
  205. data/doc/TaskJuggler/TextScanner.html +285 -273
  206. data/doc/TaskJuggler/TextScanner/BufferStreamHandle.html +17 -7
  207. data/doc/TaskJuggler/TextScanner/FileStreamHandle.html +24 -14
  208. data/doc/TaskJuggler/TextScanner/MacroStackEntry.html +11 -1
  209. data/doc/TaskJuggler/TextScanner/StreamHandle.html +64 -52
  210. data/doc/TaskJuggler/TimeSheet.html +11 -1
  211. data/doc/TaskJuggler/TimeSheetReceiver.html +11 -1
  212. data/doc/TaskJuggler/TimeSheetRecord.html +11 -1
  213. data/doc/TaskJuggler/TimeSheetReport.html +11 -1
  214. data/doc/TaskJuggler/TimeSheetSender.html +11 -1
  215. data/doc/TaskJuggler/TimeSheetSummary.html +11 -1
  216. data/doc/TaskJuggler/TimeSheets.html +11 -1
  217. data/doc/TaskJuggler/Tj3AppBase.html +11 -1
  218. data/doc/TaskJuggler/Tj3Client.html +11 -1
  219. data/doc/TaskJuggler/Tj3Daemon.html +11 -1
  220. data/doc/TaskJuggler/Tj3SheetAppBase.html +11 -1
  221. data/doc/TaskJuggler/Tj3SsReceiver.html +11 -1
  222. data/doc/TaskJuggler/Tj3SsSender.html +11 -1
  223. data/doc/TaskJuggler/Tj3TsReceiver.html +11 -1
  224. data/doc/TaskJuggler/Tj3TsSender.html +11 -1
  225. data/doc/TaskJuggler/Tj3TsSummary.html +11 -1
  226. data/doc/TaskJuggler/TjException.html +11 -1
  227. data/doc/TaskJuggler/TjTime.html +474 -324
  228. data/doc/TaskJuggler/TjpExample.html +11 -1
  229. data/doc/TaskJuggler/TjpExportRE.html +11 -1
  230. data/doc/TaskJuggler/TjpSyntaxRules.html +3731 -3662
  231. data/doc/TaskJuggler/URLParameter.html +11 -1
  232. data/doc/TaskJuggler/UserManual.html +11 -1
  233. data/doc/TaskJuggler/VimSyntax.html +11 -1
  234. data/doc/TaskJuggler/WebServer.html +11 -1
  235. data/doc/TaskJuggler/WorkingHours.html +295 -221
  236. data/doc/TaskJuggler/WorkingHoursAttribute.html +11 -1
  237. data/doc/TaskJuggler/XMLBlob.html +11 -1
  238. data/doc/TaskJuggler/XMLComment.html +11 -1
  239. data/doc/TaskJuggler/XMLDocument.html +11 -1
  240. data/doc/TaskJuggler/XMLElement.html +11 -1
  241. data/doc/TaskJuggler/XMLNamedText.html +11 -1
  242. data/doc/TaskJuggler/XMLText.html +11 -1
  243. data/doc/index.html +694 -624
  244. data/doc/lib/AppConfig_rb.html +1 -1
  245. data/doc/lib/Attributes_rb.html +1 -1
  246. data/doc/lib/Booking_rb.html +1 -1
  247. data/doc/lib/DataCache_rb.html +69 -0
  248. data/doc/lib/KeywordDocumentation_rb.html +1 -1
  249. data/doc/lib/ProjectFileParser_rb.html +1 -1
  250. data/doc/lib/ProjectFileScanner_rb.html +1 -1
  251. data/doc/lib/Project_rb.html +1 -1
  252. data/doc/lib/PropertyList_rb.html +1 -1
  253. data/doc/lib/Query_rb.html +1 -1
  254. data/doc/lib/RealFormat_rb.html +1 -1
  255. data/doc/lib/ResourceScenario_rb.html +1 -1
  256. data/doc/lib/Resource_rb.html +1 -1
  257. data/doc/lib/RichTextParser_rb.html +1 -1
  258. data/doc/lib/RichTextScanner_rb.html +1 -1
  259. data/doc/lib/RichTextSyntaxRules_rb.html +1 -1
  260. data/doc/lib/RichText_rb.html +1 -1
  261. data/doc/lib/Scoreboard_rb.html +1 -1
  262. data/doc/lib/StatusSheetSender_rb.html +1 -1
  263. data/doc/lib/SyntaxReference_rb.html +1 -1
  264. data/doc/lib/TaskJuggler_rb.html +1 -1
  265. data/doc/lib/TaskScenario_rb.html +3 -1
  266. data/doc/lib/TextParser/Pattern_rb.html +3 -1
  267. data/doc/lib/TextParser/Rule_rb.html +3 -1
  268. data/doc/lib/TextParser/StackElement_rb.html +3 -1
  269. data/doc/lib/TextParser/State_rb.html +65 -0
  270. data/doc/lib/TextParser_rb.html +1 -1
  271. data/doc/lib/TextScanner_rb.html +1 -1
  272. data/doc/lib/Tj3Config_rb.html +1 -1
  273. data/doc/lib/TjTime_rb.html +1 -1
  274. data/doc/lib/TjpSyntaxRules_rb.html +1 -1
  275. data/doc/lib/WorkingHours_rb.html +3 -1
  276. data/doc/lib/daemon/ReportServer_rb.html +1 -1
  277. data/doc/lib/reports/CSVFile_rb.html +1 -1
  278. data/doc/lib/reports/CollisionDetector_rb.html +67 -0
  279. data/doc/lib/reports/GanttChart_rb.html +1 -1
  280. data/doc/lib/reports/GanttRouter_rb.html +3 -1
  281. data/doc/lib/reports/Navigator_rb.html +1 -1
  282. data/doc/lib/reports/ReportBase_rb.html +1 -1
  283. data/doc/lib/reports/ReportTableCell_rb.html +1 -1
  284. data/doc/lib/reports/ReportTableColumn_rb.html +1 -1
  285. data/doc/lib/reports/ReportTableLine_rb.html +1 -1
  286. data/doc/lib/reports/ReportTable_rb.html +1 -1
  287. data/doc/lib/reports/Report_rb.html +1 -1
  288. data/doc/lib/reports/TableReport_rb.html +1 -1
  289. data/doc/lib/taskjuggler3_rb.html +1 -1
  290. data/examples/tutorial.tjp +1 -2
  291. data/lib/AppConfig.rb +10 -4
  292. data/lib/Attributes.rb +4 -4
  293. data/lib/DataCache.rb +124 -0
  294. data/lib/KeywordDocumentation.rb +5 -5
  295. data/lib/Project.rb +54 -10
  296. data/lib/ProjectFileParser.rb +10 -9
  297. data/lib/ProjectFileScanner.rb +38 -25
  298. data/lib/PropertyList.rb +6 -4
  299. data/lib/Query.rb +0 -8
  300. data/lib/RealFormat.rb +1 -1
  301. data/lib/Resource.rb +1 -1
  302. data/lib/ResourceScenario.rb +96 -31
  303. data/lib/RichText.rb +17 -5
  304. data/lib/RichTextParser.rb +22 -9
  305. data/lib/RichTextScanner.rb +34 -34
  306. data/lib/RichTextSyntaxRules.rb +41 -36
  307. data/lib/Scoreboard.rb +16 -7
  308. data/lib/StatusSheetSender.rb +63 -0
  309. data/lib/SyntaxReference.rb +9 -10
  310. data/lib/TaskJuggler.rb +28 -4
  311. data/lib/TaskScenario.rb +66 -19
  312. data/lib/TextParser.rb +219 -384
  313. data/lib/TextParser/Pattern.rb +168 -49
  314. data/lib/TextParser/Rule.rb +33 -17
  315. data/lib/TextParser/StackElement.rb +42 -2
  316. data/lib/TextParser/State.rb +175 -0
  317. data/lib/TextScanner.rb +19 -15
  318. data/lib/Tj3Config.rb +1 -1
  319. data/lib/TjTime.rb +111 -3
  320. data/lib/TjpSyntaxRules.rb +122 -66
  321. data/lib/WorkingHours.rb +91 -186
  322. data/lib/daemon/ReportServer.rb +3 -2
  323. data/lib/reports/CSVFile.rb +1 -1
  324. data/lib/reports/CollisionDetector.rb +177 -0
  325. data/lib/reports/GanttChart.rb +25 -41
  326. data/lib/reports/GanttRouter.rb +104 -233
  327. data/lib/reports/Navigator.rb +1 -1
  328. data/lib/reports/Report.rb +9 -33
  329. data/lib/reports/ReportBase.rb +0 -1
  330. data/lib/reports/ReportTable.rb +19 -8
  331. data/lib/reports/ReportTableCell.rb +61 -25
  332. data/lib/reports/ReportTableColumn.rb +2 -2
  333. data/lib/reports/ReportTableLine.rb +4 -2
  334. data/lib/reports/TableReport.rb +1 -0
  335. data/lib/taskjuggler3.rb +0 -1
  336. data/manual/Installation +7 -3
  337. data/manual/Intro +12 -10
  338. data/manual/The_TaskJuggler_Syntax +4 -4
  339. data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -14
  340. data/test/TestSuite/CSV-Reports/genrefs +1 -1
  341. data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -4
  342. data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -22
  343. data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -14
  344. data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -14
  345. data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -14
  346. data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -14
  347. data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -14
  348. data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +32 -24
  349. data/test/TestSuite/CSV-Reports/weekly-Reference.csv +13 -0
  350. data/test/TestSuite/CSV-Reports/weekly.tjp +9 -0
  351. data/test/TestSuite/HTML-Reports/css/tjreport.css +7 -2
  352. data/test/TestSuite/HTML-Reports/depArrows.html +839 -830
  353. data/test/TestSuite/HTML-Reports/depArrows.tjp +12 -12
  354. data/test/TestSuite/HTML-Reports/profile.html +37581 -0
  355. data/test/TestSuite/ReportGenerator/Errors/no_report_defined.tjp +7 -0
  356. data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.tjp +1 -1
  357. data/test/TestSuite/StatusSheets/TimeSheets/2002-03-01/missing-reports +2 -0
  358. data/test/TestSuite/StatusSheets/run +2 -0
  359. data/test/TestSuite/Syntax/Correct/Booking.tjp +13 -5
  360. data/test/TestSuite/Syntax/Correct/ResourceRoot.tjp +21 -0
  361. data/test/TestSuite/Syntax/Correct/RollupResource.tjp +21 -0
  362. data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +1 -1
  363. data/test/TestSuite/Syntax/Errors/empty.tjp +1 -1
  364. data/test/TestSuite/Syntax/Errors/include_before_project.tjp +2 -0
  365. data/test/TestSuite/Syntax/Errors/no_reduce.tjp +6 -0
  366. data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +1 -1
  367. data/test/TestSuite/TimeSheets/run +1 -1
  368. data/test/test_CSV-Reports.rb +2 -4
  369. data/test/test_CollisionDetector.rb +85 -0
  370. data/test/test_Project.rb +2 -2
  371. data/test/test_ProjectFileScanner.rb +73 -31
  372. data/test/test_Query.rb +2 -2
  373. data/test/test_ReportGenerator.rb +1 -1
  374. data/test/test_RichText.rb +4 -4
  375. data/test/test_WorkingHours.rb +150 -11
  376. metadata +75 -67
  377. data/test/TestSuite/ReportGenerator/Errors/css/tjreport.css +0 -407
  378. data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.html +0 -26
  379. data/test/TestSuite/Scheduler/Correct/Allocate.html +0 -3210
  380. data/test/TestSuite/Scheduler/Correct/Container.html +0 -349
  381. data/test/TestSuite/Scheduler/Correct/Limits.html +0 -4964
  382. data/test/TestSuite/Scheduler/Correct/Shift.html +0 -1719
  383. data/test/TestSuite/Scheduler/Correct/Shift2.html +0 -476
  384. data/test/TestSuite/Scheduler/Correct/css/tjmanual.css +0 -66
  385. data/test/TestSuite/Scheduler/Correct/icons/details.png +0 -0
  386. data/test/TestSuite/Scheduler/Correct/icons/flag-green.png +0 -0
  387. data/test/TestSuite/Scheduler/Correct/icons/flag-red.png +0 -0
  388. data/test/TestSuite/Scheduler/Correct/icons/flag-yellow.png +0 -0
  389. data/test/TestSuite/Scheduler/Correct/icons/resource.png +0 -0
  390. data/test/TestSuite/Scheduler/Correct/icons/resourcegroup.png +0 -0
  391. data/test/TestSuite/Scheduler/Correct/icons/task.png +0 -0
  392. data/test/TestSuite/Scheduler/Correct/icons/taskgroup.png +0 -0
  393. data/test/TestSuite/Scheduler/Correct/icons/trend-down.png +0 -0
  394. data/test/TestSuite/Scheduler/Correct/icons/trend-flat.png +0 -0
  395. data/test/TestSuite/Scheduler/Correct/icons/trend-up.png +0 -0
  396. data/test/TestSuite/Scheduler/Correct/scripts/wz_tooltip.js +0 -1301
  397. data/test/TestSuite/Scheduler/Errors/css/tjmanual.css +0 -66
  398. data/test/TestSuite/Scheduler/Errors/css/tjreport.css +0 -407
  399. data/test/TestSuite/Scheduler/Errors/icons/details.png +0 -0
  400. data/test/TestSuite/Scheduler/Errors/icons/flag-green.png +0 -0
  401. data/test/TestSuite/Scheduler/Errors/icons/flag-red.png +0 -0
  402. data/test/TestSuite/Scheduler/Errors/icons/flag-yellow.png +0 -0
  403. data/test/TestSuite/Scheduler/Errors/icons/resource.png +0 -0
  404. data/test/TestSuite/Scheduler/Errors/icons/resourcegroup.png +0 -0
  405. data/test/TestSuite/Scheduler/Errors/icons/task.png +0 -0
  406. data/test/TestSuite/Scheduler/Errors/icons/taskgroup.png +0 -0
  407. data/test/TestSuite/Scheduler/Errors/icons/trend-down.png +0 -0
  408. data/test/TestSuite/Scheduler/Errors/icons/trend-flat.png +0 -0
  409. data/test/TestSuite/Scheduler/Errors/icons/trend-up.png +0 -0
  410. data/test/TestSuite/Scheduler/Errors/scripts/wz_tooltip.js +0 -1301
  411. data/test/TestSuite/StatusSheets/resrep.tji +0 -7
  412. data/test/TestSuite/StatusSheets/tj3d.log +0 -312
  413. data/test/TestSuite/Syntax/Correct/Managers.html +0 -263
  414. data/test/TestSuite/TimeSheets/acceptable_intervals +0 -1
  415. data/test/TestSuite/TimeSheets/statussheets.log +0 -1
data/lib/RichText.rb CHANGED
@@ -73,6 +73,10 @@ class TaskJuggler
73
73
 
74
74
  attr_reader :inputText, :messageHandler
75
75
 
76
+ # The Parser uses complex to setup data structures that are identical for
77
+ # all RichText instances. So, we'll share them across the instances.
78
+ @@parser = nil
79
+
76
80
  # Create a rich text object by passing a String with markup elements to it.
77
81
  # _text_ must be plain text with MediaWiki compatible markup elements. In
78
82
  # case an error occurs, an exception of type TjException will be raised.
@@ -94,12 +98,20 @@ class TaskJuggler
94
98
  @functionHandlers.each do |h|
95
99
  rti.registerFunctionHandler(h)
96
100
  end
97
- # Parse the input text into an abstract syntax tree.
98
- parser = RichTextParser.new(@messageHandler, rti, sectionCounter,
99
- tokenSet)
100
- parser.open(@inputText)
101
+
102
+ # We'll setup the RichTextParser once and share it across all instances.
103
+ if @@parser
104
+ # We already have a RichTextParser that we can reuse.
105
+ @@parser.reuse(@messageHandler, rti, sectionCounter, tokenSet)
106
+ else
107
+ # There is no RichTextParser yet, create one.
108
+ @@parser = RichTextParser.new(@messageHandler, rti, sectionCounter,
109
+ tokenSet)
110
+ end
111
+
112
+ @@parser.open(@inputText)
101
113
  # Parse the input text and convert it to the intermediate representation.
102
- return nil if (tree = parser.parse('richtext')) == false
114
+ return nil if (tree = @@parser.parse(:richtext)) == false
103
115
 
104
116
  # In case the result is empty, use an empty RichTextElement as result
105
117
  tree = RichTextElement.new(rti, :richtext, nil) unless tree
@@ -32,24 +32,37 @@ class TaskJuggler
32
32
  super(messageHandler)
33
33
  @richTextI = rti
34
34
  # These are the tokens that can be returned by the RichTextScanner.
35
- @variables = %w( LINEBREAK SPACE WORD BOLD ITALIC CODE BOLDITALIC PRE
36
- HREF HREFEND REF REFEND HLINE
37
- QUERY
38
- INLINEFUNCSTART INLINEFUNCEND
39
- BLOCKFUNCSTART BLOCKFUNCEND ID STRING
40
- TITLE1 TITLE2 TITLE3 TITLE4
41
- TITLE1END TITLE2END TITLE3END TITLE4END
42
- BULLET1 BULLET2 BULLET3 BULLET4
43
- NUMBER1 NUMBER2 NUMBER3 NUMBER4 )
35
+ @variables = [ :LINEBREAK, :SPACE, :WORD,
36
+ :BOLD, :ITALIC, :CODE, :BOLDITALIC, :PRE,
37
+ :HREF, :HREFEND, :REF, :REFEND, :HLINE,
38
+ :QUERY,
39
+ :INLINEFUNCSTART, :INLINEFUNCEND,
40
+ :BLOCKFUNCSTART, :BLOCKFUNCEND, :ID, :STRING,
41
+ :TITLE1, :TITLE2, :TITLE3, :TITLE4,
42
+ :TITLE1END, :TITLE2END, :TITLE3END, :TITLE4END,
43
+ :BULLET1, :BULLET2, :BULLET3, :BULLET4,
44
+ :NUMBER1, :NUMBER2, :NUMBER3, :NUMBER4
45
+ ]
44
46
  limitTokenSet(tokenSet)
45
47
  # Load the rule set into the parser.
46
48
  initRules
49
+ updateParserTables
47
50
  # The sections and numbered list can each nest 3 levels deep. We use these
48
51
  # counter Arrays to generate proper 1.2.3 type labels.
49
52
  @sectionCounter = sectionCounter
50
53
  @numberListCounter = [ 0, 0, 0, 0 ]
51
54
  end
52
55
 
56
+ def reuse(messageHandler, rti, sectionCounter = [ 0, 0, 0, 0],
57
+ tokenSet = nil)
58
+ @blockedVariables = {}
59
+ @stack = nil
60
+ @richTextI = rti
61
+ @messageHandler = messageHandler
62
+ @sectionCounter = sectionCounter
63
+ limitTokenSet(tokenSet)
64
+ end
65
+
53
66
  # Construct the parser and get ready to read.
54
67
  def open(text)
55
68
  # Make sure that the last line is properly terminated with a newline.
@@ -32,61 +32,61 @@ class TaskJuggler
32
32
  def initialize(masterFile, messageHandler)
33
33
  tokenPatterns = [
34
34
  # :bol mode rules
35
- [ 'LINEBREAK', /\s*\n/, :bol, method('linebreak') ],
35
+ [ :LINEBREAK, /\s*\n/, :bol, method('linebreak') ],
36
36
  [ nil, /\s+/, :bol, method('inlineMode') ],
37
37
 
38
38
  # :bop mode rules
39
- [ 'PRE', / [^\n]+\n?/, :bop, method('pre') ],
39
+ [ :PRE, / [^\n]+\n?/, :bop, method('pre') ],
40
40
  [ nil, /\s*\n/, :bop, method('linebreak') ],
41
41
 
42
42
  # :inline mode rules
43
- [ 'SPACE', /[ \t\n]+/, :inline, method('space') ],
43
+ [ :SPACE, /[ \t\n]+/, :inline, method('space') ],
44
44
 
45
45
  # :bop and :bol mode rules
46
- [ 'INLINEFUNCSTART', /<-/, [ :bop, :bol, :inline ],
46
+ [ :INLINEFUNCSTART, /<-/, [ :bop, :bol, :inline ],
47
47
  method('functionStart') ],
48
- [ 'BLOCKFUNCSTART', /<\[/, [ :bop, :bol ], method('functionStart') ],
49
- [ 'TITLE*', /={2,5}/, [ :bop, :bol ], method('titleStart') ],
48
+ [ :BLOCKFUNCSTART, /<\[/, [ :bop, :bol ], method('functionStart') ],
49
+ [ ':TITLE*', /={2,5}/, [ :bop, :bol ], method('titleStart') ],
50
50
  [ 'TITLE*END', /={2,5}/, :inline, method('titleEnd') ],
51
51
  [ 'BULLET*', /\*{1,4} /, [ :bop, :bol ], method('bullet') ],
52
52
  [ 'NUMBER*', /\#{1,4} /, [ :bop, :bol ], method('number') ],
53
- [ 'HLINE', /----/, [ :bop, :bol ], method('inlineMode') ],
53
+ [ :HLINE, /----/, [ :bop, :bol ], method('inlineMode') ],
54
54
 
55
55
  # :bop, :bol and :inline mode rules
56
56
  # The <nowiki> token puts the scanner into :nowiki mode.
57
57
  [ nil, /<nowiki>/, [ :bop, :bol, :inline ], method('nowikiStart') ],
58
- [ 'QUOTES', /'{2,5}/, [ :bop, :bol, :inline ], method('quotes') ],
59
- [ 'REF', /\[\[/, [ :bop, :bol, :inline ], method('refStart') ],
60
- [ 'HREF', /\[/, [ :bop, :bol, :inline], method('hrefStart') ],
61
- [ 'WORD', /.[^ \n\t\[<']*/, [ :bop, :bol, :inline ],
58
+ [ :QUOTES, /'{2,5}/, [ :bop, :bol, :inline ], method('quotes') ],
59
+ [ :REF, /\[\[/, [ :bop, :bol, :inline ], method('refStart') ],
60
+ [ :HREF, /\[/, [ :bop, :bol, :inline], method('hrefStart') ],
61
+ [ :WORD, /.[^ \n\t\[<']*/, [ :bop, :bol, :inline ],
62
62
  method('inlineMode') ],
63
63
 
64
64
  # :nowiki mode rules
65
65
  [ nil, /<\/nowiki>/, :nowiki, method('nowikiEnd') ],
66
- [ 'WORD', /(<(?!\/nowiki>)|[^ \t\n<])+/, :nowiki ],
67
- [ 'SPACE', /[ \t]+/, :nowiki ],
68
- [ 'LINEBREAK', /\s*\n/, :nowiki ],
66
+ [ :WORD, /(<(?!\/nowiki>)|[^ \t\n<])+/, :nowiki ],
67
+ [ :SPACE, /[ \t]+/, :nowiki ],
68
+ [ :LINEBREAK, /\s*\n/, :nowiki ],
69
69
 
70
70
  # :ref mode rules
71
- [ 'REFEND', /\]\]/, :ref, method('refEnd') ],
72
- [ 'WORD', /(<(?!-)|(\](?!\])|[^|<\]]))+/, :ref ],
73
- [ 'QUERY', /<-\w+->/, :ref, method('query') ],
74
- [ 'LITERAL', /./, :ref ],
71
+ [ :REFEND, /\]\]/, :ref, method('refEnd') ],
72
+ [ :WORD, /(<(?!-)|(\](?!\])|[^|<\]]))+/, :ref ],
73
+ [ :QUERY, /<-\w+->/, :ref, method('query') ],
74
+ [ :LITERAL, /./, :ref ],
75
75
 
76
76
  # :href mode rules
77
- [ 'HREFEND', /\]/, :href, method('hrefEnd') ],
78
- [ 'WORD', /(<(?!-)|[^ \t\n\]<])+/, :href ],
79
- [ 'QUERY', /<-\w+->/, :href, method('query') ],
80
- [ 'SPACE', /[ \t\n]+/, :href ],
77
+ [ :HREFEND, /\]/, :href, method('hrefEnd') ],
78
+ [ :WORD, /(<(?!-)|[^ \t\n\]<])+/, :href ],
79
+ [ :QUERY, /<-\w+->/, :href, method('query') ],
80
+ [ :SPACE, /[ \t\n]+/, :href ],
81
81
 
82
82
  # :func mode rules
83
- [ 'INLINEFUNCEND', /->/ , :func, method('functionEnd') ],
84
- [ 'BLOCKFUNCEND', /\]>/, :func, method('functionEnd') ],
85
- [ 'ID', /[a-zA-Z_]\w*/, :func ],
86
- [ 'STRING', /"(\\"|[^"])*"/, :func, method('dqString') ],
87
- [ 'STRING', /'(\\'|[^'])*'/, :func, method('sqString') ],
83
+ [ :INLINEFUNCEND, /->/ , :func, method('functionEnd') ],
84
+ [ :BLOCKFUNCEND, /\]>/, :func, method('functionEnd') ],
85
+ [ :ID, /[a-zA-Z_]\w*/, :func ],
86
+ [ :STRING, /"(\\"|[^"])*"/, :func, method('dqString') ],
87
+ [ :STRING, /'(\\'|[^'])*'/, :func, method('sqString') ],
88
88
  [ nil, /[ \t\n]+/, :func ],
89
- [ 'LITERAL', /./, :func ]
89
+ [ :LITERAL, /./, :func ]
90
90
  ]
91
91
  super(masterFile, messageHandler, tokenPatterns, :bop)
92
92
  end
@@ -100,7 +100,7 @@ class TaskJuggler
100
100
  # And return an empty string.
101
101
  match = ''
102
102
  end
103
- [type, match ]
103
+ [ type, match ]
104
104
  end
105
105
 
106
106
  def linebreak(type, match)
@@ -115,26 +115,26 @@ class TaskJuggler
115
115
 
116
116
  def titleStart(type, match)
117
117
  self.mode = :inline
118
- [ "TITLE#{match.length - 1}", match ]
118
+ [ "TITLE#{match.length - 1}".intern, match ]
119
119
  end
120
120
 
121
121
  def titleEnd(type, match)
122
- [ "TITLE#{match.length - 1}END", match ]
122
+ [ "TITLE#{match.length - 1}END".intern, match ]
123
123
  end
124
124
 
125
125
  def bullet(type, match)
126
126
  self.mode = :inline
127
- [ "BULLET#{match.length - 1}", match ]
127
+ [ "BULLET#{match.length - 1}".intern, match ]
128
128
  end
129
129
 
130
130
  def number(type, match)
131
131
  self.mode = :inline
132
- [ "NUMBER#{match.length - 1}", match ]
132
+ [ "NUMBER#{match.length - 1}".intern, match ]
133
133
  end
134
134
 
135
135
  def quotes(type, match)
136
136
  self.mode = :inline
137
- types = [ nil, nil, 'ITALIC', 'BOLD' , 'CODE', 'BOLDITALIC' ]
137
+ types = [ nil, nil, :ITALIC, :BOLD , :CODE, :BOLDITALIC ]
138
138
  [ types[match.length], match ]
139
139
  end
140
140
 
@@ -35,32 +35,38 @@ class TaskJuggler
35
35
  })
36
36
  end
37
37
 
38
- # The following syntax elements are all block elements that can span
39
- # multiple lines.
40
38
  def rule_sections
41
39
  optional
42
40
  repeatable
43
- pattern(%w( !headlines !blankLines ), lambda {
41
+ pattern(%w( !section !blankLines ), lambda {
44
42
  @val[0]
45
43
  })
46
- pattern(%w( $HLINE !blankLines ), lambda {
44
+ end
45
+
46
+ # The following syntax elements are all block elements that can span
47
+ # multiple lines.
48
+ def rule_section
49
+ pattern(%w( !headlines ), lambda {
50
+ @val[0]
51
+ })
52
+ pattern(%w( $HLINE ), lambda {
47
53
  RichTextElement.new(@richTextI, :hline, @val[0])
48
54
  })
49
- pattern(%w( !paragraph !blankLines ), lambda {
55
+ pattern(%w( !paragraph ), lambda {
50
56
  @val[0]
51
57
  })
52
- pattern(%w( !pre !blankLines ), lambda {
58
+ pattern(%w( !pre ), lambda {
53
59
  RichTextElement.new(@richTextI, :pre, @val[0].join)
54
60
  })
55
- pattern(%w( !bulletList1 !blankLines ), lambda {
61
+ pattern(%w( !bulletList1 ), lambda {
56
62
 
57
63
  RichTextElement.new(@richTextI, :bulletlist1, @val[0])
58
64
  })
59
- pattern(%w( !numberList1 !blankLines ), lambda {
65
+ pattern(%w( !numberList1 ), lambda {
60
66
  @numberListCounter = [ 0, 0, 0, 0 ]
61
67
  RichTextElement.new(@richTextI, :numberlist1, @val[0])
62
68
  })
63
- pattern(%w( !blockFunction !blankLines ), lambda {
69
+ pattern(%w( !blockFunction ), lambda {
64
70
  @val[0]
65
71
  })
66
72
  end
@@ -242,19 +248,19 @@ class TaskJuggler
242
248
  # Since the italic end marker will disappear we need to make sure
243
249
  # there was no space before it.
244
250
  @val[2].last.appendSpace = false if @val[2].last
245
- el.appendSpace = !@val[4].empty?
251
+ el.appendSpace = !@val[4].nil?
246
252
  el
247
253
  })
248
254
  pattern(%w( $BOLD !space !plainTextWithLinks $BOLD !space ), lambda {
249
255
  el = RichTextElement.new(@richTextI, :bold, @val[2])
250
256
  @val[2].last.appendSpace = false if @val[2].last
251
- el.appendSpace = !@val[4].empty?
257
+ el.appendSpace = !@val[4].nil?
252
258
  el
253
259
  })
254
260
  pattern(%w( $CODE !space !plainTextWithLinks $CODE !space ), lambda {
255
261
  el = RichTextElement.new(@richTextI, :code, @val[2])
256
262
  @val[2].last.appendSpace = false if @val[2].last
257
- el.appendSpace = !@val[4].empty?
263
+ el.appendSpace = !@val[4].nil?
258
264
  el
259
265
  })
260
266
  pattern(%w( $BOLDITALIC !space !plainTextWithLinks $BOLDITALIC !space ),
@@ -263,13 +269,12 @@ class TaskJuggler
263
269
  :bold, RichTextElement.new(@richTextI,
264
270
  :italic, @val[2]))
265
271
  @val[2].last.appendSpace = false if @val[2].last
266
- el.appendSpace = !@val[4].empty?
272
+ el.appendSpace = !@val[4].nil?
267
273
  el
268
274
  })
269
275
  end
270
276
 
271
277
  def rule_plainTextWithLinks
272
- repeatable
273
278
  pattern(%w( !plainText ), lambda {
274
279
  @val[0]
275
280
  })
@@ -291,34 +296,34 @@ class TaskJuggler
291
296
  error('rt_file_bad_ext', "Unsupported file type: #{extension}")
292
297
  end
293
298
  el.data = img = RichTextImage.new(locator)
294
- @val[2].each do |token|
295
- if token[0, 4] == 'alt='
296
- img.altText = token[4..-1]
297
- elsif %w( top middle bottom baseline sub super text-top
298
- text-bottom ).include?(token)
299
- img.verticalAlign = token
300
- else
301
- error('rt_bad_file_option',
302
- "Unknown option '#{token}' for file reference " +
303
- "#{v1}.")
299
+ if @val[2]
300
+ @val[2].each do |token|
301
+ if token[0, 4] == 'alt='
302
+ img.altText = token[4..-1]
303
+ elsif %w( top middle bottom baseline sub super text-top
304
+ text-bottom ).include?(token)
305
+ img.verticalAlign = token
306
+ else
307
+ error('rt_bad_file_option',
308
+ "Unknown option '#{token}' for file reference " +
309
+ "#{v1}.")
310
+ end
304
311
  end
305
312
  end
306
313
  else
314
+ val = @val[2] || v1
307
315
  el = RichTextElement.new(@richTextI, :ref,
308
- RichTextElement.new(@richTextI,
309
- :text, @val[2].empty? ?
310
- v1 : @val[2]))
316
+ RichTextElement.new(@richTextI, :text, val))
311
317
  el.data = v1
312
- el.appendSpace = !@val[4].empty?
318
+ el.appendSpace = !@val[4].nil?
313
319
  end
314
320
  el
315
321
  })
316
322
  pattern(%w( $HREF !wordWithQueries !space !plainTextWithQueries
317
323
  $HREFEND !space ), lambda {
318
- el = RichTextElement.new(@richTextI, :href, @val[3].empty? ?
319
- @val[1] : @val[3])
324
+ el = RichTextElement.new(@richTextI, :href, @val[3] || @val[1])
320
325
  el.data = RichTextElement.new(@richTextI, :richtext, @val[1])
321
- el.appendSpace = !@val[5].empty?
326
+ el.appendSpace = !@val[5].nil?
322
327
  el
323
328
  })
324
329
  end
@@ -361,7 +366,7 @@ class TaskJuggler
361
366
  optional
362
367
  pattern(%w( $WORD !space ), lambda {
363
368
  el = RichTextElement.new(@richTextI, :text, @val[0])
364
- el.appendSpace = !@val[1].empty?
369
+ el.appendSpace = !@val[1].nil?
365
370
  el
366
371
  })
367
372
  end
@@ -370,7 +375,7 @@ class TaskJuggler
370
375
  repeatable
371
376
  optional
372
377
  pattern(%w( !wordWithQueries !space ), lambda {
373
- @val[0][-1].appendSpace = true if !@val[1].empty?
378
+ @val[0][-1].appendSpace = true if @val[1]
374
379
  @val[0]
375
380
  })
376
381
  end
@@ -394,7 +399,7 @@ class TaskJuggler
394
399
  pattern(%w( $BLOCKFUNCSTART $ID !functionArguments $BLOCKFUNCEND ),
395
400
  lambda {
396
401
  args = {}
397
- @val[2].each { |arg| args[arg[0]] = arg[1] }
402
+ @val[2].each { |arg| args[arg[0]] = arg[1] } if @val[2]
398
403
  el = RichTextElement.new(@richTextI, :blockfunc)
399
404
  # Data is a 2 element Array with the function name and a Hash for the
400
405
  # arguments.
@@ -412,7 +417,7 @@ class TaskJuggler
412
417
  !space ),
413
418
  lambda {
414
419
  args = {}
415
- @val[2].each { |arg| args[arg[0]] = arg[1] }
420
+ @val[2].each { |arg| args[arg[0]] = arg[1] } if @val[2]
416
421
  el = RichTextElement.new(@richTextI, :inlinefunc)
417
422
  # Data is a 2 element Array with the function name and a Hash for the
418
423
  # arguments.
@@ -421,7 +426,7 @@ class TaskJuggler
421
426
  "Unsupported inline function #{@val[1]}")
422
427
  end
423
428
  el.data = [@val[1], args ]
424
- el.appendSpace = !@val[4].empty?
429
+ el.appendSpace = !@val[4].nil?
425
430
  el
426
431
  })
427
432
  end
data/lib/Scoreboard.rb CHANGED
@@ -52,20 +52,29 @@ class TaskJuggler
52
52
  # Converts a date to the corresponding scoreboard index. You can optionally
53
53
  # sanitize the _date_ by forcing it into the project time span.
54
54
  def dateToIdx(date, forceIntoProject = false)
55
+ idx = ((date - @startDate) / @resolution).to_i
56
+
55
57
  if forceIntoProject
56
- return 0 if date < @startDate
57
- return @size - 1 if date >= @endDate
58
- elsif date < @startDate || date > @endDate
58
+ return 0 if idx < 0
59
+ return @size - 1 if idx >= @size
60
+ elsif (idx < 0 || idx >= @size)
59
61
  raise "Date #{date} is out of project time range " +
60
62
  "(#{@startDate} - #{@endDate})"
61
63
  end
62
- ((date - @startDate) / @resolution).to_i
64
+
65
+ idx
63
66
  end
64
67
 
65
68
  # Iterate over all scoreboard entries.
66
- def each
67
- @sb.each do |entry|
68
- yield entry
69
+ def each(startIdx = 0, endIdx = @size)
70
+ if startIdx != 0 || endIdx != @size
71
+ startIdx.upto(endIdx - 1) do |i|
72
+ yield @sb[i]
73
+ end
74
+ else
75
+ @sb.each do |entry|
76
+ yield entry
77
+ end
69
78
  end
70
79
  end
71
80
 
@@ -30,6 +30,8 @@ class TaskJuggler
30
30
  @hideResource = '0'
31
31
  # The base directory of the status sheet templates.
32
32
  @templateDir = 'StatusSheetTemplates'
33
+ # The base directory of the received time sheets.
34
+ @timeSheetDir = 'TimeSheets'
33
35
  # This file contains the time intervals that the StatusSheetReceiver will
34
36
  # accept as a valid interval.
35
37
  @signatureFile = "#{@templateDir}/acceptable_intervals"
@@ -46,9 +48,70 @@ text, UTF-8 encoded and the status sheet header from 'statussheet' to the period
46
48
  end date must be in a single line that starts at the beginning of the line.
47
49
 
48
50
  EOT
51
+ # tj3ts_summary generates a list of resources that have not submitted
52
+ # their reports yet. If you want to generate the warning below, make
53
+ # sure you run tj3ts_summary immediately before you sent the status sheet
54
+ # templates.
55
+ defaulters = defaulterList
56
+ unless defaulters.empty?
57
+ @introText += <<"EOT"
58
+ =============================== W A R N I N G ==============================
59
+
60
+ The following people have not submitted their report yet. The status reports
61
+ for the work they have done is not included in this template! You can either
62
+ manually add their status to the tasks or asked them to send their time sheet
63
+ immediately and re-request this template.
64
+
65
+ #{defaulters.join}
66
+
67
+ EOT
68
+ end
69
+
49
70
  @mailSubject = "Your weekly status report template for %s"
50
71
  end
51
72
 
73
+ def defaulterList
74
+ dirs = Dir.glob("#{@timeSheetDir}/????-??-??").sort
75
+ tsDir = nil
76
+ # The status sheet intervals and the time sheet intervals are not
77
+ # identical. The status sheet interval can be smaller and is somewhat
78
+ # later. But it always includes the end date of the corresponding time
79
+ # sheet period. To get the file with the IDs of the resources that have
80
+ # not submitted their report, we need to find the time sheet directory
81
+ # that is within the status sheet period.
82
+ repDate = Time.local(*@date.split('-'))
83
+ dirs.each do |dir|
84
+ dirDate = Time.local(*dir[-10..-1].split('-'))
85
+ if dirDate < repDate
86
+ tsDir = dir
87
+ else
88
+ break
89
+ end
90
+ end
91
+ # Check if there is a time sheet directory.
92
+ return [] unless tsDir
93
+
94
+ missingFile = "#{tsDir}/missing-reports"
95
+ # Check if it's got a missing-reports file.
96
+ return [] if !File.exists?(missingFile)
97
+
98
+ # The sheet could have been submitted after tj3ts_summary was run. We
99
+ # ignore the entry if a time sheet file now exists. There is a race
100
+ # condition here. The file may exist, but it may not yet be loaded for
101
+ # the current project that is used to generate the status report. There
102
+ # is a race condition here. The file may exist, but it may not yet be
103
+ # loaded for the current project that is used to generate the status
104
+ # report.
105
+ list = File.readlines(missingFile)
106
+ list.delete_if do |resource|
107
+ tsDate = tsDir[-10..-1]
108
+ File.exists?("#{tsDir}/#{resource.chomp}_#{tsDate}.tji")
109
+ end
110
+
111
+ # Return the content of the file.
112
+ list
113
+ end
114
+
52
115
  end
53
116
 
54
117
  end