taskjuggler 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (571) hide show
  1. data/COPYING +280 -0
  2. data/README +31 -0
  3. data/Rakefile +20 -0
  4. data/benchmarks/UTF-8-Strings.rb +58 -0
  5. data/benchmarks/allocate.tjp +30 -0
  6. data/benchmarks/booking.tjp +62 -0
  7. data/benchmarks/depends.tjp +112 -0
  8. data/benchmarks/htmltaskreport.tjp +45 -0
  9. data/benchmarks/runbench.rb +24 -0
  10. data/bin/tj3 +3 -0
  11. data/bin/tj3man +3 -0
  12. data/doc/classes/AppConfig.html +808 -0
  13. data/doc/classes/Arguments.html +226 -0
  14. data/doc/classes/String.html +395 -0
  15. data/doc/classes/TaskJuggler.html +1358 -0
  16. data/doc/classes/TaskJuggler/Account.html +257 -0
  17. data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
  18. data/doc/classes/TaskJuggler/Allocation.html +419 -0
  19. data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
  20. data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
  21. data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
  22. data/doc/classes/TaskJuggler/Booking.html +307 -0
  23. data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
  24. data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
  25. data/doc/classes/TaskJuggler/CSVFile.html +325 -0
  26. data/doc/classes/TaskJuggler/Charge.html +279 -0
  27. data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
  28. data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
  29. data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
  30. data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
  31. data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
  32. data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
  33. data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
  34. data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
  35. data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
  36. data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
  37. data/doc/classes/TaskJuggler/GanttChart.html +667 -0
  38. data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
  39. data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
  40. data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
  41. data/doc/classes/TaskJuggler/GanttLine.html +398 -0
  42. data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
  43. data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
  44. data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
  45. data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
  46. data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
  47. data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
  48. data/doc/classes/TaskJuggler/Interval.html +552 -0
  49. data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
  50. data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
  51. data/doc/classes/TaskJuggler/Limits.html +416 -0
  52. data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
  53. data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
  54. data/doc/classes/TaskJuggler/Log.html +613 -0
  55. data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
  56. data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
  57. data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
  58. data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
  59. data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
  60. data/doc/classes/TaskJuggler/Macro.html +194 -0
  61. data/doc/classes/TaskJuggler/MacroParser.html +360 -0
  62. data/doc/classes/TaskJuggler/MacroTable.html +366 -0
  63. data/doc/classes/TaskJuggler/Message.html +281 -0
  64. data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
  65. data/doc/classes/TaskJuggler/Project.html +1606 -0
  66. data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
  67. data/doc/classes/TaskJuggler/PropertyList.html +597 -0
  68. data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
  69. data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
  70. data/doc/classes/TaskJuggler/Query.html +600 -0
  71. data/doc/classes/TaskJuggler/RealFormat.html +252 -0
  72. data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
  73. data/doc/classes/TaskJuggler/Report.html +528 -0
  74. data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
  75. data/doc/classes/TaskJuggler/ReportTable.html +497 -0
  76. data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
  77. data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
  78. data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
  79. data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
  80. data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
  81. data/doc/classes/TaskJuggler/Resource.html +211 -0
  82. data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
  83. data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
  84. data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
  85. data/doc/classes/TaskJuggler/RichText.html +537 -0
  86. data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
  87. data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
  88. data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
  89. data/doc/classes/TaskJuggler/RichTextException.html +212 -0
  90. data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
  91. data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
  92. data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
  93. data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
  94. data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
  95. data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
  96. data/doc/classes/TaskJuggler/Scenario.html +163 -0
  97. data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
  98. data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
  99. data/doc/classes/TaskJuggler/Shift.html +255 -0
  100. data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
  101. data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
  102. data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
  103. data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
  104. data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
  105. data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
  106. data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
  107. data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
  108. data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
  109. data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
  110. data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
  111. data/doc/classes/TaskJuggler/Task.html +203 -0
  112. data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
  113. data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
  114. data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
  115. data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
  116. data/doc/classes/TaskJuggler/TextParser.html +670 -0
  117. data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
  118. data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
  119. data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
  120. data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
  121. data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
  122. data/doc/classes/TaskJuggler/TextScanner.html +708 -0
  123. data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
  124. data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
  125. data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
  126. data/doc/classes/TaskJuggler/TjException.html +185 -0
  127. data/doc/classes/TaskJuggler/TjTime.html +1845 -0
  128. data/doc/classes/TaskJuggler/TjpExample.html +310 -0
  129. data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
  130. data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
  131. data/doc/classes/TaskJuggler/UserManual.html +606 -0
  132. data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
  133. data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
  134. data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
  135. data/doc/classes/TaskJuggler/XMLComment.html +206 -0
  136. data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
  137. data/doc/classes/TaskJuggler/XMLElement.html +341 -0
  138. data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
  139. data/doc/classes/TaskJuggler/XMLText.html +221 -0
  140. data/doc/files/COPYING.html +448 -0
  141. data/doc/files/README.html +134 -0
  142. data/doc/files/lib/AccountScenario_rb.html +116 -0
  143. data/doc/files/lib/Account_rb.html +118 -0
  144. data/doc/files/lib/Allocation_rb.html +118 -0
  145. data/doc/files/lib/AppConfig_rb.html +116 -0
  146. data/doc/files/lib/AttributeBase_rb.html +106 -0
  147. data/doc/files/lib/AttributeDefinition_rb.html +106 -0
  148. data/doc/files/lib/Attributes_rb.html +130 -0
  149. data/doc/files/lib/Booking_rb.html +106 -0
  150. data/doc/files/lib/ChargeSet_rb.html +116 -0
  151. data/doc/files/lib/Charge_rb.html +116 -0
  152. data/doc/files/lib/HTMLDocument_rb.html +116 -0
  153. data/doc/files/lib/Interval_rb.html +116 -0
  154. data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
  155. data/doc/files/lib/Limits_rb.html +116 -0
  156. data/doc/files/lib/Log_rb.html +116 -0
  157. data/doc/files/lib/LogicalExpression_rb.html +122 -0
  158. data/doc/files/lib/LogicalFlag_rb.html +116 -0
  159. data/doc/files/lib/LogicalFunction_rb.html +116 -0
  160. data/doc/files/lib/LogicalOperation_rb.html +116 -0
  161. data/doc/files/lib/MacroParser_rb.html +118 -0
  162. data/doc/files/lib/MacroTable_rb.html +122 -0
  163. data/doc/files/lib/MessageHandler_rb.html +106 -0
  164. data/doc/files/lib/Message_rb.html +116 -0
  165. data/doc/files/lib/ProjectFileParser_rb.html +122 -0
  166. data/doc/files/lib/Project_rb.html +148 -0
  167. data/doc/files/lib/PropertyList_rb.html +106 -0
  168. data/doc/files/lib/PropertySet_rb.html +118 -0
  169. data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
  170. data/doc/files/lib/Query_rb.html +116 -0
  171. data/doc/files/lib/RealFormat_rb.html +106 -0
  172. data/doc/files/lib/ResourceScenario_rb.html +116 -0
  173. data/doc/files/lib/Resource_rb.html +118 -0
  174. data/doc/files/lib/RichTextDocument_rb.html +120 -0
  175. data/doc/files/lib/RichTextElement_rb.html +120 -0
  176. data/doc/files/lib/RichTextParser_rb.html +120 -0
  177. data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
  178. data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
  179. data/doc/files/lib/RichTextScanner_rb.html +116 -0
  180. data/doc/files/lib/RichTextSnip_rb.html +118 -0
  181. data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
  182. data/doc/files/lib/RichText_rb.html +118 -0
  183. data/doc/files/lib/ScenarioData_rb.html +118 -0
  184. data/doc/files/lib/Scenario_rb.html +116 -0
  185. data/doc/files/lib/Scoreboard_rb.html +106 -0
  186. data/doc/files/lib/ShiftAssignments_rb.html +116 -0
  187. data/doc/files/lib/ShiftScenario_rb.html +116 -0
  188. data/doc/files/lib/Shift_rb.html +118 -0
  189. data/doc/files/lib/SourceFileInfo_rb.html +106 -0
  190. data/doc/files/lib/SyntaxReference_rb.html +122 -0
  191. data/doc/files/lib/TOCEntry_rb.html +118 -0
  192. data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
  193. data/doc/files/lib/TableOfContents_rb.html +118 -0
  194. data/doc/files/lib/TaskDependency_rb.html +106 -0
  195. data/doc/files/lib/TaskJuggler_rb.html +120 -0
  196. data/doc/files/lib/TaskScenario_rb.html +116 -0
  197. data/doc/files/lib/Task_rb.html +118 -0
  198. data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
  199. data/doc/files/lib/TextParser/Rule_rb.html +106 -0
  200. data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
  201. data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
  202. data/doc/files/lib/TextParser_rb.html +124 -0
  203. data/doc/files/lib/TextScanner_rb.html +128 -0
  204. data/doc/files/lib/Tj3Config_rb.html +118 -0
  205. data/doc/files/lib/TjException_rb.html +106 -0
  206. data/doc/files/lib/TjTime_rb.html +118 -0
  207. data/doc/files/lib/TjpExample_rb.html +116 -0
  208. data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
  209. data/doc/files/lib/UTF8String_rb.html +132 -0
  210. data/doc/files/lib/UserManual_rb.html +124 -0
  211. data/doc/files/lib/WorkingHours_rb.html +116 -0
  212. data/doc/files/lib/XMLDocument_rb.html +116 -0
  213. data/doc/files/lib/XMLElement_rb.html +116 -0
  214. data/doc/files/lib/reports/CSVFile_rb.html +116 -0
  215. data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
  216. data/doc/files/lib/reports/GanttChart_rb.html +122 -0
  217. data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
  218. data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
  219. data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
  220. data/doc/files/lib/reports/GanttLine_rb.html +126 -0
  221. data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
  222. data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
  223. data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
  224. data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
  225. data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
  226. data/doc/files/lib/reports/ReportElement_rb.html +118 -0
  227. data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
  228. data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
  229. data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
  230. data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
  231. data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
  232. data/doc/files/lib/reports/ReportTable_rb.html +118 -0
  233. data/doc/files/lib/reports/Report_rb.html +126 -0
  234. data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
  235. data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
  236. data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
  237. data/doc/files/lib/taskjuggler3_rb.html +276 -0
  238. data/doc/files/lib/tj3man_rb.html +189 -0
  239. data/doc/fr_class_index.html +285 -0
  240. data/doc/fr_file_index.html +223 -0
  241. data/doc/fr_method_index.html +1953 -0
  242. data/doc/index.html +21 -0
  243. data/doc/rdoc-style.css +299 -0
  244. data/examples/tutorial.tjp +361 -0
  245. data/gem_spec.rb +30 -0
  246. data/lib/Account.rb +50 -0
  247. data/lib/AccountScenario.rb +39 -0
  248. data/lib/Allocation.rb +102 -0
  249. data/lib/AppConfig.rb +134 -0
  250. data/lib/AttributeBase.rb +131 -0
  251. data/lib/AttributeDefinition.rb +47 -0
  252. data/lib/Attributes.rb +478 -0
  253. data/lib/BatchProcessor.rb +209 -0
  254. data/lib/Booking.rb +59 -0
  255. data/lib/Charge.rb +71 -0
  256. data/lib/ChargeSet.rb +126 -0
  257. data/lib/HTMLDocument.rb +59 -0
  258. data/lib/Interval.rb +127 -0
  259. data/lib/KeywordDocumentation.rb +560 -0
  260. data/lib/Limits.rb +219 -0
  261. data/lib/Log.rb +160 -0
  262. data/lib/LogicalExpression.rb +71 -0
  263. data/lib/LogicalFlag.rb +34 -0
  264. data/lib/LogicalFunction.rb +102 -0
  265. data/lib/LogicalOperation.rb +118 -0
  266. data/lib/MacroParser.rb +77 -0
  267. data/lib/MacroTable.rb +84 -0
  268. data/lib/Message.rb +56 -0
  269. data/lib/MessageHandler.rb +34 -0
  270. data/lib/Project.rb +662 -0
  271. data/lib/ProjectFileParser.rb +333 -0
  272. data/lib/PropertyList.rb +181 -0
  273. data/lib/PropertySet.rb +304 -0
  274. data/lib/PropertyTreeNode.rb +461 -0
  275. data/lib/Query.rb +227 -0
  276. data/lib/RealFormat.rb +73 -0
  277. data/lib/Resource.rb +42 -0
  278. data/lib/ResourceScenario.rb +511 -0
  279. data/lib/RichText.rb +147 -0
  280. data/lib/RichTextDocument.rb +139 -0
  281. data/lib/RichTextElement.rb +391 -0
  282. data/lib/RichTextParser.rb +66 -0
  283. data/lib/RichTextProtocolExample.rb +65 -0
  284. data/lib/RichTextProtocolHandler.rb +35 -0
  285. data/lib/RichTextScanner.rb +390 -0
  286. data/lib/RichTextSnip.rb +104 -0
  287. data/lib/RichTextSyntaxRules.rb +265 -0
  288. data/lib/Scenario.rb +27 -0
  289. data/lib/ScenarioData.rb +65 -0
  290. data/lib/Scoreboard.rb +141 -0
  291. data/lib/Shift.rb +48 -0
  292. data/lib/ShiftAssignments.rb +291 -0
  293. data/lib/ShiftScenario.rb +46 -0
  294. data/lib/SourceFileInfo.rb +37 -0
  295. data/lib/SyntaxReference.rb +284 -0
  296. data/lib/TOCEntry.rb +76 -0
  297. data/lib/TableColumnDefinition.rb +54 -0
  298. data/lib/TableOfContents.rb +46 -0
  299. data/lib/Task.rb +37 -0
  300. data/lib/TaskDependency.rb +39 -0
  301. data/lib/TaskJuggler.rb +84 -0
  302. data/lib/TaskScenario.rb +1622 -0
  303. data/lib/TextParser.rb +416 -0
  304. data/lib/TextParser/Pattern.rb +263 -0
  305. data/lib/TextParser/Rule.rb +171 -0
  306. data/lib/TextParser/StackElement.rb +45 -0
  307. data/lib/TextParser/TokenDoc.rb +38 -0
  308. data/lib/TextScanner.rb +682 -0
  309. data/lib/Tj3Config.rb +27 -0
  310. data/lib/TjException.rb +27 -0
  311. data/lib/TjTime.rb +395 -0
  312. data/lib/TjpExample.rb +119 -0
  313. data/lib/TjpSyntaxRules.rb +4022 -0
  314. data/lib/UTF8String.rb +100 -0
  315. data/lib/UserManual.rb +282 -0
  316. data/lib/WorkingHours.rb +323 -0
  317. data/lib/XMLDocument.rb +54 -0
  318. data/lib/XMLElement.rb +175 -0
  319. data/lib/reports/CSVFile.rb +146 -0
  320. data/lib/reports/ColumnTable.rb +66 -0
  321. data/lib/reports/GanttChart.rb +308 -0
  322. data/lib/reports/GanttContainer.rb +107 -0
  323. data/lib/reports/GanttHeader.rb +141 -0
  324. data/lib/reports/GanttHeaderScaleItem.rb +42 -0
  325. data/lib/reports/GanttLine.rb +329 -0
  326. data/lib/reports/GanttLoadStack.rb +113 -0
  327. data/lib/reports/GanttMilestone.rb +80 -0
  328. data/lib/reports/GanttRouter.rb +375 -0
  329. data/lib/reports/GanttTaskBar.rb +95 -0
  330. data/lib/reports/HTMLGraphics.rb +65 -0
  331. data/lib/reports/Report.rb +344 -0
  332. data/lib/reports/ReportElement.rb +427 -0
  333. data/lib/reports/ReportTable.rb +144 -0
  334. data/lib/reports/ReportTableCell.rb +142 -0
  335. data/lib/reports/ReportTableColumn.rb +82 -0
  336. data/lib/reports/ReportTableElement.rb +852 -0
  337. data/lib/reports/ReportTableLegend.rb +167 -0
  338. data/lib/reports/ReportTableLine.rb +87 -0
  339. data/lib/reports/ResourceListRE.rb +72 -0
  340. data/lib/reports/TaskListRE.rb +73 -0
  341. data/lib/reports/TjpExportRE.rb +394 -0
  342. data/lib/taskjuggler3.rb +106 -0
  343. data/lib/tj3man.rb +88 -0
  344. data/manual/Day_To_Day_Juggling +168 -0
  345. data/manual/Getting_Started +61 -0
  346. data/manual/How_To_Contribute +185 -0
  347. data/manual/Installation +68 -0
  348. data/manual/Intro +102 -0
  349. data/manual/Reporting_Bugs +26 -0
  350. data/manual/Rich_Text_Attributes +90 -0
  351. data/manual/TaskJuggler_2x_Migration +40 -0
  352. data/manual/Tutorial +579 -0
  353. data/manual/fdl +450 -0
  354. data/prj_cfg.rb +43 -0
  355. data/setup.rb +1585 -0
  356. data/tasks/csts.rake +72 -0
  357. data/tasks/gem.rake +14 -0
  358. data/tasks/manual.rake +10 -0
  359. data/tasks/missing.rake +21 -0
  360. data/tasks/rcov.rake +14 -0
  361. data/tasks/rdoc.rake +17 -0
  362. data/tasks/rexml_fix.rb +16 -0
  363. data/tasks/rexml_fix_19.rb +49 -0
  364. data/tasks/show.rake +21 -0
  365. data/tasks/stats.rake +25 -0
  366. data/tasks/test.rake +11 -0
  367. data/test/MessageChecker.rb +53 -0
  368. data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
  369. data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
  370. data/test/TestSuite/CSV-Reports/genrefs +6 -0
  371. data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
  372. data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
  373. data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
  374. data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
  375. data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
  376. data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
  377. data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
  378. data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
  379. data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
  380. data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
  381. data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
  382. data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
  383. data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
  384. data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
  385. data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
  386. data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
  387. data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
  388. data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
  389. data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
  390. data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
  391. data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
  392. data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
  393. data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
  394. data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
  395. data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
  396. data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
  397. data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
  398. data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
  399. data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
  400. data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
  401. data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
  402. data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
  403. data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
  404. data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
  405. data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
  406. data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
  407. data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
  408. data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
  409. data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
  410. data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
  411. data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
  412. data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
  413. data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
  414. data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
  415. data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
  416. data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
  417. data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
  418. data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
  419. data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
  420. data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
  421. data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
  422. data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
  423. data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
  424. data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
  425. data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
  426. data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
  427. data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
  428. data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
  429. data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
  430. data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
  431. data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
  432. data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
  433. data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
  434. data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
  435. data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
  436. data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
  437. data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
  438. data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
  439. data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
  440. data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
  441. data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
  442. data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
  443. data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
  444. data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
  445. data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
  446. data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
  447. data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
  448. data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
  449. data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
  450. data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
  451. data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
  452. data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
  453. data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
  454. data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
  455. data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
  456. data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
  457. data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
  458. data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
  459. data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
  460. data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
  461. data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
  462. data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
  463. data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
  464. data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
  465. data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
  466. data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
  467. data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
  468. data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
  469. data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
  470. data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
  471. data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
  472. data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
  473. data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
  474. data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
  475. data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
  476. data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
  477. data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
  478. data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
  479. data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
  480. data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
  481. data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
  482. data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
  483. data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
  484. data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
  485. data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
  486. data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
  487. data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
  488. data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
  489. data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
  490. data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
  491. data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
  492. data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
  493. data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
  494. data/test/TestSuite/Syntax/Correct/csvtest +16 -0
  495. data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
  496. data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
  497. data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
  498. data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
  499. data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
  500. data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
  501. data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
  502. data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
  503. data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
  504. data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
  505. data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
  506. data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
  507. data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
  508. data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
  509. data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
  510. data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
  511. data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
  512. data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
  513. data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
  514. data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
  515. data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
  516. data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
  517. data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
  518. data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
  519. data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
  520. data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
  521. data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
  522. data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
  523. data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
  524. data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
  525. data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
  526. data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
  527. data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
  528. data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
  529. data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
  530. data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
  531. data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
  532. data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
  533. data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
  534. data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
  535. data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
  536. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
  537. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
  538. data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
  539. data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
  540. data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
  541. data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
  542. data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
  543. data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
  544. data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
  545. data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
  546. data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
  547. data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
  548. data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
  549. data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
  550. data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
  551. data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
  552. data/test/all.rb +31 -0
  553. data/test/test_BatchProcessor.rb +54 -0
  554. data/test/test_CSV-Reports.rb +101 -0
  555. data/test/test_Limits.rb +104 -0
  556. data/test/test_LogicalExpression.rb +110 -0
  557. data/test/test_MacroTable.rb +51 -0
  558. data/test/test_Project.rb +57 -0
  559. data/test/test_PropertySet.rb +71 -0
  560. data/test/test_Query.rb +83 -0
  561. data/test/test_RealFormat.rb +83 -0
  562. data/test/test_RichText.rb +869 -0
  563. data/test/test_Scheduler.rb +42 -0
  564. data/test/test_ShiftAssignments.rb +77 -0
  565. data/test/test_Syntax.rb +41 -0
  566. data/test/test_TextScanner.rb +95 -0
  567. data/test/test_TjTime.rb +114 -0
  568. data/test/test_TjpExample.rb +169 -0
  569. data/test/test_UTF8String.rb +84 -0
  570. data/test/test_WorkingHours.rb +56 -0
  571. metadata +649 -0
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = HTMLDocument.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of version 2 of the GNU General Public License as
10
+ # published by the Free Software Foundation.
11
+ #
12
+
13
+ require 'XMLDocument'
14
+
15
+ class TaskJuggler
16
+
17
+ # HTMLDocument objects are a specialized form of XMLDocument objects. All
18
+ # mandatory elements of a proper HTML document will be added automatically
19
+ # upon object creation.
20
+ class HTMLDocument < XMLDocument
21
+
22
+ # When creating a HTMLDocument the caller can specify the type of HTML that
23
+ # will be used. The constructor then generates the proper XML declaration
24
+ # for it. :strict, :transitional and :frameset are supported for _docType_.
25
+ def initialize(docType = :transitional)
26
+ super()
27
+
28
+ @elements << XMLBlob.new('<?xml version="1.0" encoding="utf8"?>')
29
+ case docType
30
+ when :strict
31
+ dtdRef = 'Strict'
32
+ url = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
33
+ when :transitional
34
+ dtdRef = 'Transitional'
35
+ url = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'
36
+ when :frameset
37
+ dtdRef = 'Frameset'
38
+ url = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd'
39
+ else
40
+ raise "Unsupported docType"
41
+ end
42
+ @elements << XMLBlob.new('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ' +
43
+ "#{dtdRef}//EN\" \"#{url}\">")
44
+ @elements << XMLComment.new('This file has been generated by ' +
45
+ "#{AppConfig.appName} v#{AppConfig.version}")
46
+ @elements << (@html = XMLElement.new('html', 'xml:lang' => 'en',
47
+ 'lang' => 'en', 'xmlns' => 'http://www.w3.org/1999/xhtml'))
48
+ end
49
+
50
+ # Overload the << operator to append to the @html element instead of the
51
+ # @elements Array.
52
+ def <<(element)
53
+ @html << element
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = Interval.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of version 2 of the GNU General Public License as
10
+ # published by the Free Software Foundation.
11
+ #
12
+
13
+ require 'TjTime'
14
+
15
+ class TaskJuggler
16
+
17
+ # The Interval class provides objects that model a time interval. The start
18
+ # end end time are represented as seconds after Jan 1, 1970. The start is part
19
+ # of the interval, the end is not.
20
+ class Interval
21
+
22
+ attr_accessor :start, :end
23
+
24
+ # Create a new Interval. _args_ can be three different kind of arguments.
25
+ #
26
+ # a and b should be TjTime objects.
27
+ #
28
+ # Interval.new(a, b) | -> Interval(a, b)
29
+ # Interval.new(a) | -> Interval(a, a)
30
+ # Interval.new(iv) | -> Interval(iv.start, iv.end)
31
+ #
32
+ def initialize(*args)
33
+ if args.length == 1
34
+ if args[0].is_a?(TjTime)
35
+ # Just one argument, a date
36
+ @start = @end = args[0]
37
+ elsif args[0].is_a?(Interval)
38
+ # Just one argument, an Interval
39
+ @start = args[0].start
40
+ @end = args[0].end
41
+ else
42
+ raise "Illegal argument"
43
+ end
44
+ elsif args.length == 2
45
+ # Two arguments, a start and end date
46
+ @start = args[0]
47
+ @end = args[1]
48
+ if @end < @start
49
+ raise "Invalid interval"
50
+ end
51
+ else
52
+ raise "Illegal arguments"
53
+ end
54
+ end
55
+
56
+ # Return the duration of the Interval.
57
+ def duration
58
+ @end - @start
59
+ end
60
+
61
+ # Return true if _arg_ is contained within the Interval. It can either be a
62
+ # single TjTime or another Interval.
63
+ def contains?(arg)
64
+ if arg.is_a?(TjTime)
65
+ return @start <= arg && arg < @end
66
+ else
67
+ return @start <= arg.start && arg.end <= @end
68
+ end
69
+ end
70
+
71
+ # Check whether the Interval _arg_ overlaps with this interval.
72
+ def overlaps?(arg)
73
+ if arg.is_a?(TjTime)
74
+ return @start <= arg && arg < @end
75
+ else
76
+ return (@start <= arg.start && arg.start < @end) ||
77
+ (arg.start <= @start && @start < arg.end)
78
+ end
79
+ end
80
+
81
+ # Return a new Interval that contains the overlap of self and the Interval
82
+ # _iv_. In case there is no overlap, nil is returned.
83
+ def intersection(iv)
84
+ newStart = @start > iv.start ? @start : iv.start
85
+ newEnd = @end < iv.end ? @end : iv.end
86
+ newStart < newEnd ? Interval.new(newStart, newEnd) : nil
87
+ end
88
+
89
+ # Append or prepend the Interval _iv_ to self. If _iv_ does not directly
90
+ # attach to self, just return self.
91
+ def combine(iv)
92
+ if iv.end == @start
93
+ # Prepend iv
94
+ Array.new Interval(iv.start, @end)
95
+ elsif @end == iv.start
96
+ # Append iv
97
+ Array.new Interval(@start, iv.end)
98
+ else
99
+ self
100
+ end
101
+ end
102
+
103
+ # Compare self with Interval _iv_. This function only works for
104
+ # non-overlapping Interval objects.
105
+ def <=>(iv)
106
+ if @end < iv.start
107
+ -1
108
+ elsif iv.end < @start
109
+ 1
110
+ end
111
+ 0
112
+ end
113
+
114
+ # Return true if the Interval _iv_ describes an identical time period.
115
+ def ==(iv)
116
+ @start == iv.start && @end == iv.end
117
+ end
118
+
119
+ # Turn the Interval into a human readable form.
120
+ def to_s
121
+ @start.to_s + ' - ' + @end.to_s
122
+ end
123
+
124
+ end
125
+
126
+ end
127
+
@@ -0,0 +1,560 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = KeywordDocumentation.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of version 2 of the GNU General Public License as
10
+ # published by the Free Software Foundation.
11
+ #
12
+
13
+ require 'HTMLDocument'
14
+ require 'RichText'
15
+ require 'TjpExample'
16
+ require 'Project'
17
+
18
+ class TaskJuggler
19
+
20
+ # The textual TaskJuggler Project description consists of many keywords. The
21
+ # parser has built-in support to document the meaning and usage of these
22
+ # keywords. Most keywords are unique, but there can be exceptions. To
23
+ # resolve ambiguoties the keywords can be prefixed by a scope. The scope is
24
+ # usually a keyword that describes the context that the ambiguous keyword is
25
+ # used in. This class stores the keyword, the corresponding
26
+ # TextParser::Pattern and the context that the keyword is used in. It also
27
+ # stores information such as the list of optional attributes (keywords used
28
+ # in the context of the current keyword) and whether the keyword is scenario
29
+ # specific or not.
30
+ class KeywordDocumentation
31
+
32
+ attr_reader :keyword, :pattern, :references
33
+ attr_accessor :contexts, :scenarioSpecific, :inheritable,
34
+ :predecessor, :successor
35
+
36
+ # Construct a new KeywordDocumentation object. _rule_ is the
37
+ # TextParser::Rule and _pattern_ is the corresponding TextParser::Pattern.
38
+ # _syntax_ is an expanded syntax representation of the _pattern_. _args_
39
+ # is a Array of ParserTokenDoc that describe the arguments of the
40
+ # _pattern_. _optAttrPatterns_ is an Array with references to
41
+ # TextParser::Patterns that are optional attributes to this keyword.
42
+ def initialize(rule, pattern, syntax, args, optAttrPatterns, manual)
43
+ @rule = rule
44
+ @pattern = pattern
45
+ @keyword = pattern.keyword
46
+ @syntax = syntax
47
+ @args = args
48
+ # Hash that maps patterns of optional attributes to a boolean value. It
49
+ # is true if the pattern is a scenario specific attribute.
50
+ @optAttrPatterns = optAttrPatterns
51
+ @manual = manual
52
+ # The above hash is later converted into a list that points to the
53
+ # keyword documentation of the optional attribute.
54
+ @optionalAttributes = []
55
+ @scenarioSpecific = false
56
+ @inheritable = false
57
+ @contexts = []
58
+ @seeAlso = []
59
+ # The following are references to the neighboring keyword in an
60
+ # alphabetically sorted list.
61
+ @predecessor = nil
62
+ @successor = nil
63
+ # Array to collect all references to other RichText objects.
64
+ @references = []
65
+ end
66
+
67
+ # Post process the class member to set cross references to other
68
+ # KeywordDocumentation items.
69
+ def crossReference(keywords, rules)
70
+ # Some arguments are references to other patterns. The current keyword
71
+ # is added as context to such patterns.
72
+ @args.each do |arg|
73
+ if arg.pattern && checkReference(arg.pattern)
74
+ kwd = keywords[arg.pattern.keyword]
75
+ kwd.contexts << self unless kwd.contexts.include?(self)
76
+ end
77
+ end
78
+
79
+ # Optional attributes are treated similarly. In addition we add them to
80
+ # the @optionalAttributes list of this keyword.
81
+ @optAttrPatterns.each do |pattern, scenarioSpecific|
82
+ next unless checkReference(pattern)
83
+
84
+ if (kwd = keywords[pattern.keyword]).nil?
85
+ token = pattern.terminalToken(rules)
86
+ $stderr.puts "Keyword #{keyword} has undocumented optional " +
87
+ "attribute #{token[0]}"
88
+ else
89
+ @optionalAttributes << kwd
90
+ kwd.contexts << self unless kwd.contexts.include?(self)
91
+ kwd.scenarioSpecific = true if scenarioSpecific
92
+ end
93
+ end
94
+
95
+ # Resolve the seeAlso patterns to keyword references.
96
+ @pattern.seeAlso.sort.each do |also|
97
+ if keywords[also].nil?
98
+ raise "See also reference #{also} of #{@pattern} is unknown"
99
+ end
100
+ @seeAlso << keywords[also]
101
+ end
102
+ end
103
+
104
+ def computeInheritance(keywords, rules)
105
+ property = nil
106
+ @contexts.each do |kwd|
107
+ if %w( task resource account shift scenario).include?(kwd.keyword)
108
+ property = kwd.keyword
109
+ break
110
+ end
111
+ end
112
+ if property
113
+ project = Project.new('id', 'dummy', '1.0', nil)
114
+ propertySet = case property
115
+ when 'task'
116
+ project.tasks
117
+ when 'resource'
118
+ project.resources
119
+ when 'account'
120
+ project.accounts
121
+ when 'shift'
122
+ project.shifts
123
+ when 'scenario'
124
+ project.scenarios
125
+ end
126
+ @inheritable = propertySet.inheritable?(keyword)
127
+ end
128
+ end
129
+
130
+ # Return the keyword name in a more readable form. E.g. 'foo.bar' is
131
+ # returned as 'foo (bar)'. 'foo' will remain 'foo'.
132
+ def title
133
+ kwTokens = @keyword.split('.')
134
+ if kwTokens.size == 1
135
+ title = @keyword
136
+ else
137
+ title = "#{kwTokens[0]} (#{kwTokens[1]})"
138
+ end
139
+ title
140
+ end
141
+
142
+ # Return the complete documentation of this keyword as formatted text
143
+ # string.
144
+ def to_s
145
+ tagW = 13
146
+ textW = 79 - tagW
147
+
148
+ # Top line with multiple elements
149
+ str = "Keyword: #{@keyword} " +
150
+ "Scenario Specific: #{@scenarioSpecific ? 'Yes' : 'No'} " +
151
+ "Inheritable: #{@inheritable ? 'Yes' : 'No'}\n\n"
152
+
153
+ str += "Purpose: #{format(tagW, newRichText(@pattern.doc).to_s,
154
+ textW)}\n\n"
155
+
156
+ if @syntax != '[{ <attributes> }]'
157
+ str += "Syntax: #{format(tagW, @syntax, textW)}\n\n"
158
+
159
+ str += "Arguments: "
160
+ if @args.empty?
161
+ str += format(tagW, "none\n\n", textW)
162
+ else
163
+ argStr = ''
164
+ @args.each do |arg|
165
+ argText = arg.text || "See #{arg.name} for details."
166
+ if arg.typeSpec.nil? || ('<' + arg.name + '>') == arg.typeSpec
167
+ indent = arg.name.length + 2
168
+ argStr += "#{arg.name}: " +
169
+ "#{format(indent, argText, textW - indent)}\n"
170
+ else
171
+ typeSpec = arg.typeSpec
172
+ typeSpec[0] = '['
173
+ typeSpec[-1] = ']'
174
+ indent = arg.name.length + typeSpec.size + 3
175
+ argStr += "#{arg.name} #{typeSpec}: " +
176
+ "#{format(indent, argText, textW - indent)}\n"
177
+ end
178
+ end
179
+ str += format(tagW, argStr, textW)
180
+ end
181
+ str += "\n"
182
+ end
183
+
184
+ str += 'Context: '
185
+ if @contexts.empty?
186
+ str += format(tagW, 'Global scope', textW)
187
+ else
188
+ cxtStr = ''
189
+ @contexts.each do |context|
190
+ unless cxtStr.empty?
191
+ cxtStr += ', '
192
+ end
193
+ cxtStr += context.keyword
194
+ end
195
+ str += format(tagW, cxtStr, textW)
196
+ end
197
+
198
+ str += "\n\nAttributes: "
199
+ if @optionalAttributes.empty?
200
+ str += "none\n\n"
201
+ else
202
+ attrStr = ''
203
+ @optionalAttributes.sort! do |a, b|
204
+ a.keyword <=> b.keyword
205
+ end
206
+ @optionalAttributes.each do |attr|
207
+ unless attrStr.empty?
208
+ attrStr += ', '
209
+ end
210
+ attrStr += '[sc:]' if attr.scenarioSpecific
211
+ attrStr += attr.keyword
212
+ end
213
+ str += format(tagW, attrStr, textW)
214
+ str += "\n"
215
+ end
216
+
217
+ unless @seeAlso.empty?
218
+ str += "See also: "
219
+ alsoStr = ''
220
+ @seeAlso.each do |also|
221
+ unless alsoStr.empty?
222
+ alsoStr += ', '
223
+ end
224
+ alsoStr += also.keyword
225
+ end
226
+ str += format(tagW, alsoStr, textW)
227
+ str += "\n"
228
+ end
229
+
230
+ # str += "Rule: #{@rule.name}\n" if @rule
231
+ # str += "Pattern: #{@pattern.tokens.join(' ')}\n" if @pattern
232
+ str
233
+ end
234
+
235
+ # Return a String that represents the keyword documentation in an XML
236
+ # formatted form.
237
+ def generateHTML(directory)
238
+ html = HTMLDocument.new(:transitional)
239
+ html << (head = XMLElement.new('head'))
240
+ head << XMLNamedText.new("#{keyword}", 'title') <<
241
+ @manual.generateStyleSheet
242
+
243
+ html << (body = XMLElement.new('body'))
244
+ body << @manual.generateHTMLHeader <<
245
+ generateHTMLNavigationBar
246
+
247
+ # Box with keyword name.
248
+ body << (bbox = XMLElement.new('div',
249
+ 'style' => 'margin-left:5%; margin-right:5%'))
250
+ bbox << (p = XMLElement.new('p'))
251
+ p << (tab = XMLElement.new('table', 'align' => 'center',
252
+ 'class' => 'table'))
253
+
254
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
255
+ tr << XMLNamedText.new('Keyword', 'td', 'class' => 'tag',
256
+ 'style' => 'width:15%')
257
+ tr << XMLNamedText.new(title, 'td', 'class' => 'descr',
258
+ 'style' => 'width:85%; font-weight:bold')
259
+
260
+ # Box with purpose, syntax, arguments and context.
261
+ bbox << (p = XMLElement.new('p'))
262
+ p << (tab = XMLElement.new('table', 'align' => 'center',
263
+ 'class' => 'table'))
264
+ tab << (colgroup = XMLElement.new('colgroup'))
265
+ colgroup << XMLElement.new('col', 'width' => '15%')
266
+ colgroup << XMLElement.new('col', 'width' => '85%')
267
+
268
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
269
+ tr << XMLNamedText.new('Purpose', 'td', 'class' => 'tag')
270
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
271
+ td << newRichText(@pattern.doc).to_html
272
+ if @syntax != '[{ <attributes> }]'
273
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
274
+ tr << XMLNamedText.new('Syntax', 'td', 'class' => 'tag')
275
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
276
+ td << XMLNamedText.new("#{@syntax}", 'code')
277
+
278
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
279
+ tr << XMLNamedText.new('Arguments', 'td', 'class' => 'tag')
280
+ if @args.empty?
281
+ tr << XMLNamedText.new('none', 'td', 'class' => 'descr')
282
+ else
283
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
284
+ td << (tab1 = XMLElement.new('table', 'width' => '100%'))
285
+ @args.each do |arg|
286
+ tab1 << (tr1 = XMLElement.new('tr'))
287
+ if arg.typeSpec.nil? || ('<' + arg.name + '>') == arg.typeSpec
288
+ tr1 << XMLNamedText.new("#{arg.name}", 'td', 'width' => '30%')
289
+ else
290
+ typeSpec = arg.typeSpec
291
+ typeSpec[0] = '['
292
+ typeSpec[-1] = ']'
293
+ tr1 << XMLNamedText.new("#{arg.name} #{typeSpec}", 'td',
294
+ 'width' => '30%')
295
+ end
296
+ tr1 << (td = XMLElement.new('td',
297
+ 'style' => 'margin-top:2px; margin-bottom:2px;'))
298
+ td << newRichText(arg.text ||
299
+ "See [[#{arg.name}]] for details.").to_html
300
+ end
301
+ end
302
+ end
303
+
304
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
305
+ tr << XMLNamedText.new('Context', 'td', 'class' => 'tag')
306
+ if @contexts.empty?
307
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
308
+ td << XMLNamedText.new('Global scope', 'a',
309
+ 'href' => 'Getting_Started.html#Structure_of_a_TJP_File')
310
+ else
311
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
312
+ first = true
313
+ @contexts.each do |context|
314
+ if first
315
+ first = false
316
+ else
317
+ td << XMLText.new(', ')
318
+ end
319
+ keywordHTMLRef(td, context)
320
+ end
321
+ end
322
+
323
+ unless @seeAlso.empty?
324
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
325
+ tr << XMLNamedText.new('See also', 'td', 'class' => 'tag')
326
+ first = true
327
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
328
+ @seeAlso.each do |also|
329
+ if first
330
+ first = false
331
+ else
332
+ td << XMLText.new(', ')
333
+ end
334
+ keywordHTMLRef(td, also)
335
+ end
336
+ end
337
+
338
+ # Box with attributes.
339
+ unless @optionalAttributes.empty?
340
+ @optionalAttributes.sort! do |a, b|
341
+ a.keyword <=> b.keyword
342
+ end
343
+ hasScenSpec = hasInheritable = false
344
+ none = []
345
+ scenSpec = []
346
+ inheritable = []
347
+ scenSpecInheritable = []
348
+ @optionalAttributes.each do |attr|
349
+ if attr.inheritable
350
+ hasInheritable = true
351
+ if attr.scenarioSpecific
352
+ hasScenSpec = true
353
+ scenSpecInheritable << attr
354
+ else
355
+ inheritable << attr
356
+ end
357
+ else
358
+ if attr.scenarioSpecific
359
+ hasScenSpec = true
360
+ scenSpec << attr
361
+ else
362
+ none << attr
363
+ end
364
+ end
365
+ end
366
+ bbox << (p = XMLElement.new('p'))
367
+ p << (tab = XMLElement.new('table', 'align' => 'center',
368
+ 'class' => 'table'))
369
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
370
+ tr << XMLNamedText.new('Attributes', 'td', 'class' => 'tag',
371
+ 'style' => 'width:15%')
372
+ if hasScenSpec || hasInheritable
373
+ tr << XMLNamedText.new('Scenario specific', 'td', 'class' => 'tag',
374
+ 'style' => 'width:42%')
375
+ tr << XMLNamedText.new('Not scenario specific', 'td', 'class' => 'tag',
376
+ 'style' => 'width:43%')
377
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
378
+ tr << XMLNamedText.new('Inheritable', 'td', 'class' => 'tag',
379
+ 'style' => 'width:15%')
380
+ tr << listHTMLAttributes(scenSpecInheritable, 42)
381
+ tr << listHTMLAttributes(inheritable, 43)
382
+ tab << (tr = XMLElement.new('tr', 'align' => 'left'))
383
+ tr << XMLNamedText.new('Not inheritable', 'td', 'class' => 'tag',
384
+ 'style' => 'width:15%')
385
+ tr << listHTMLAttributes(scenSpec, 42)
386
+ tr << listHTMLAttributes(none, 43)
387
+ else
388
+ tr << (td = XMLElement.new('td', 'class' => 'descr'))
389
+ first = true
390
+ @optionalAttributes.each do |attr|
391
+ if first
392
+ first = false
393
+ else
394
+ td << XMLText.new(', ')
395
+ end
396
+ td << XMLText.new('[sc:]') if attr.scenarioSpecific
397
+ keywordHTMLRef(td, attr)
398
+ end
399
+ end
400
+ end
401
+
402
+ if @pattern.exampleFile
403
+ exampleDir = AppConfig.dataDirs('test')[0] + "TestSuite/Syntax/Correct/"
404
+ example = TjpExample.new
405
+ fileName = "#{exampleDir}/#{@pattern.exampleFile}.tjp"
406
+ example.open(fileName)
407
+ bbox << (frame = XMLElement.new('div', 'class' => 'codeframe'))
408
+ frame << (pre = XMLElement.new('pre', 'class' => 'code'))
409
+ unless (text = example.to_s(@pattern.exampleTag))
410
+ raise "There is no tag '#{@pattern.exampleTag}' in file " +
411
+ "#{fileName}."
412
+ end
413
+ pre << XMLText.new(text)
414
+ end
415
+
416
+ body << generateHTMLNavigationBar
417
+ body << @manual.generateHTMLFooter
418
+
419
+ if directory
420
+ html.write(directory + "#{keyword}.html")
421
+ else
422
+ puts html.to_s
423
+ end
424
+ end
425
+
426
+ private
427
+
428
+ def checkReference(pattern)
429
+ if pattern.keyword.nil?
430
+ $stderr.puts "Pattern #{pattern} is undocumented but referenced by " +
431
+ "#{@keyword}."
432
+ false
433
+ end
434
+ true
435
+ end
436
+
437
+ # Utility function that is used to format the str String as a block of the
438
+ # specified _width_. The left side is indented with _indent_ white spaces.
439
+ def format(indent, str, width)
440
+ # The result goes here.
441
+ out = ''
442
+ # Position in the currently generated line.
443
+ linePos = 0
444
+ # The currently processed word.
445
+ word = ''
446
+ # True if this is the first word in a line.
447
+ firstWord = true
448
+ # Currently processed position in the input String _str_.
449
+ i = 0
450
+ indentBuf = ''
451
+ while i < str.length
452
+ # If the current line has reached or exceeded the _width_ we generate
453
+ # a new line prefixed with the proper indentation.
454
+ if linePos >= width
455
+ out += "\n" + ' ' * indent
456
+ linePos = 0
457
+ firstWord = true
458
+ unless word.empty?
459
+ # Resume the input processing at the beginning of the word that
460
+ # did not fit into the old line anymore.
461
+ i -= word.length - 1
462
+ word = ''
463
+ next
464
+ end
465
+ end
466
+
467
+ if str[i] == ?\n
468
+ # If the input contains line breaks we generate line breaks as well.
469
+ # Insert the just finished word and wrap the line. We only put the
470
+ # indentation in a buffer as we don't know if more words will be
471
+ # following. We don't want to generate an indentation after the last
472
+ # line break.
473
+ out += indentBuf + word + "\n"
474
+ indentBuf = ' ' * indent
475
+ word = ''
476
+ linePos = 0
477
+ firstWord = true
478
+ elsif str[i] == ?\s
479
+ # We have finished processing a word of the input string.
480
+ unless indentBuf.empty?
481
+ # In case we have a pending indentation we now know that we can
482
+ # safely insert it. There will be more words following.
483
+ out += indentBuf
484
+ indentBuf = ''
485
+ end
486
+ # Append the word and initialize the word buffer with an single space.
487
+ out += word
488
+ firstWord = false
489
+ word = ' '
490
+ linePos += 1
491
+ else
492
+ # Just append the character to the word buffer and advance the
493
+ # position counter. We ignore spaces in front of the first word of
494
+ # each generated line.
495
+ unless str[i] == ' ' && firstWord
496
+ word << str[i]
497
+ end
498
+ linePos += 1
499
+ end
500
+ i += 1
501
+ end
502
+ unless word.empty? || indentBuf.empty?
503
+ out += indentBuf
504
+ end
505
+ out += word
506
+ end
507
+
508
+ # Generate the navigation bar.
509
+ def generateHTMLNavigationBar
510
+ @manual.generateHTMLNavigationBar(
511
+ @predecessor ? @predecessor.title : nil,
512
+ @predecessor ? "#{@predecessor.keyword}.html" : nil,
513
+ @successor ? @successor.title : nil,
514
+ @successor ? "#{@successor.keyword}.html" : nil)
515
+ end
516
+
517
+ # Return a HTML object with a link to the manual page for the keyword.
518
+ def keywordHTMLRef(parent, keyword)
519
+ parent << XMLNamedText.new(keyword.title,
520
+ 'a', 'href' => "#{keyword.keyword}.html")
521
+ end
522
+
523
+ # This function is primarily a wrapper around the RichText constructor. It
524
+ # catches all RichTextScanner processing problems and converts the exception
525
+ # data into an error message.
526
+ def newRichText(text)
527
+ begin
528
+ rText = RichText.new(text)
529
+ @references += rText.internalReferences
530
+ rescue RichTextException => msg
531
+ $stderr.puts "Error in RichText of rule #{@keyword}\n" +
532
+ "Line #{msg.lineNo}: #{msg.text}\n" +
533
+ "#{msg.line}"
534
+ end
535
+ rText
536
+ end
537
+
538
+ # Utility function to turn a list of keywords into a comma separated list
539
+ # of HTML references to the files of these keywords. All embedded in a
540
+ # table cell element. _list_ is the KeywordDocumentation list. _width_ is
541
+ # the percentage width of the cell.
542
+ def listHTMLAttributes(list, width)
543
+ td = XMLElement.new('td', 'class' => 'descr', 'style' => "width:#{width}%")
544
+ first = true
545
+ list.each do |attr|
546
+ if first
547
+ first = false
548
+ else
549
+ td << XMLText.new(', ')
550
+ end
551
+ keywordHTMLRef(td, attr)
552
+ end
553
+
554
+ td
555
+ end
556
+
557
+ end
558
+
559
+ end
560
+