taskjuggler 0.0.2
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.
- data/COPYING +280 -0
- data/README +31 -0
- data/Rakefile +20 -0
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/benchmarks/allocate.tjp +30 -0
- data/benchmarks/booking.tjp +62 -0
- data/benchmarks/depends.tjp +112 -0
- data/benchmarks/htmltaskreport.tjp +45 -0
- data/benchmarks/runbench.rb +24 -0
- data/bin/tj3 +3 -0
- data/bin/tj3man +3 -0
- data/doc/classes/AppConfig.html +808 -0
- data/doc/classes/Arguments.html +226 -0
- data/doc/classes/String.html +395 -0
- data/doc/classes/TaskJuggler.html +1358 -0
- data/doc/classes/TaskJuggler/Account.html +257 -0
- data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
- data/doc/classes/TaskJuggler/Allocation.html +419 -0
- data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
- data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
- data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
- data/doc/classes/TaskJuggler/Booking.html +307 -0
- data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
- data/doc/classes/TaskJuggler/CSVFile.html +325 -0
- data/doc/classes/TaskJuggler/Charge.html +279 -0
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
- data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
- data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
- data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
- data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
- data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
- data/doc/classes/TaskJuggler/GanttChart.html +667 -0
- data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
- data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
- data/doc/classes/TaskJuggler/GanttLine.html +398 -0
- data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
- data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
- data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
- data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
- data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
- data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
- data/doc/classes/TaskJuggler/Interval.html +552 -0
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
- data/doc/classes/TaskJuggler/Limits.html +416 -0
- data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
- data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/Log.html +613 -0
- data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
- data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
- data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
- data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
- data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
- data/doc/classes/TaskJuggler/Macro.html +194 -0
- data/doc/classes/TaskJuggler/MacroParser.html +360 -0
- data/doc/classes/TaskJuggler/MacroTable.html +366 -0
- data/doc/classes/TaskJuggler/Message.html +281 -0
- data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
- data/doc/classes/TaskJuggler/Project.html +1606 -0
- data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
- data/doc/classes/TaskJuggler/PropertyList.html +597 -0
- data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
- data/doc/classes/TaskJuggler/Query.html +600 -0
- data/doc/classes/TaskJuggler/RealFormat.html +252 -0
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
- data/doc/classes/TaskJuggler/Report.html +528 -0
- data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
- data/doc/classes/TaskJuggler/ReportTable.html +497 -0
- data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
- data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
- data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
- data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
- data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
- data/doc/classes/TaskJuggler/Resource.html +211 -0
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
- data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
- data/doc/classes/TaskJuggler/RichText.html +537 -0
- data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
- data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
- data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
- data/doc/classes/TaskJuggler/RichTextException.html +212 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
- data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
- data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
- data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
- data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
- data/doc/classes/TaskJuggler/Scenario.html +163 -0
- data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
- data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
- data/doc/classes/TaskJuggler/Shift.html +255 -0
- data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
- data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
- data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
- data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
- data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
- data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
- data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
- data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
- data/doc/classes/TaskJuggler/Task.html +203 -0
- data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
- data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
- data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
- data/doc/classes/TaskJuggler/TextParser.html +670 -0
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
- data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
- data/doc/classes/TaskJuggler/TextScanner.html +708 -0
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
- data/doc/classes/TaskJuggler/TjException.html +185 -0
- data/doc/classes/TaskJuggler/TjTime.html +1845 -0
- data/doc/classes/TaskJuggler/TjpExample.html +310 -0
- data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
- data/doc/classes/TaskJuggler/UserManual.html +606 -0
- data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
- data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
- data/doc/classes/TaskJuggler/XMLComment.html +206 -0
- data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
- data/doc/classes/TaskJuggler/XMLElement.html +341 -0
- data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
- data/doc/classes/TaskJuggler/XMLText.html +221 -0
- data/doc/files/COPYING.html +448 -0
- data/doc/files/README.html +134 -0
- data/doc/files/lib/AccountScenario_rb.html +116 -0
- data/doc/files/lib/Account_rb.html +118 -0
- data/doc/files/lib/Allocation_rb.html +118 -0
- data/doc/files/lib/AppConfig_rb.html +116 -0
- data/doc/files/lib/AttributeBase_rb.html +106 -0
- data/doc/files/lib/AttributeDefinition_rb.html +106 -0
- data/doc/files/lib/Attributes_rb.html +130 -0
- data/doc/files/lib/Booking_rb.html +106 -0
- data/doc/files/lib/ChargeSet_rb.html +116 -0
- data/doc/files/lib/Charge_rb.html +116 -0
- data/doc/files/lib/HTMLDocument_rb.html +116 -0
- data/doc/files/lib/Interval_rb.html +116 -0
- data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
- data/doc/files/lib/Limits_rb.html +116 -0
- data/doc/files/lib/Log_rb.html +116 -0
- data/doc/files/lib/LogicalExpression_rb.html +122 -0
- data/doc/files/lib/LogicalFlag_rb.html +116 -0
- data/doc/files/lib/LogicalFunction_rb.html +116 -0
- data/doc/files/lib/LogicalOperation_rb.html +116 -0
- data/doc/files/lib/MacroParser_rb.html +118 -0
- data/doc/files/lib/MacroTable_rb.html +122 -0
- data/doc/files/lib/MessageHandler_rb.html +106 -0
- data/doc/files/lib/Message_rb.html +116 -0
- data/doc/files/lib/ProjectFileParser_rb.html +122 -0
- data/doc/files/lib/Project_rb.html +148 -0
- data/doc/files/lib/PropertyList_rb.html +106 -0
- data/doc/files/lib/PropertySet_rb.html +118 -0
- data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
- data/doc/files/lib/Query_rb.html +116 -0
- data/doc/files/lib/RealFormat_rb.html +106 -0
- data/doc/files/lib/ResourceScenario_rb.html +116 -0
- data/doc/files/lib/Resource_rb.html +118 -0
- data/doc/files/lib/RichTextDocument_rb.html +120 -0
- data/doc/files/lib/RichTextElement_rb.html +120 -0
- data/doc/files/lib/RichTextParser_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
- data/doc/files/lib/RichTextScanner_rb.html +116 -0
- data/doc/files/lib/RichTextSnip_rb.html +118 -0
- data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
- data/doc/files/lib/RichText_rb.html +118 -0
- data/doc/files/lib/ScenarioData_rb.html +118 -0
- data/doc/files/lib/Scenario_rb.html +116 -0
- data/doc/files/lib/Scoreboard_rb.html +106 -0
- data/doc/files/lib/ShiftAssignments_rb.html +116 -0
- data/doc/files/lib/ShiftScenario_rb.html +116 -0
- data/doc/files/lib/Shift_rb.html +118 -0
- data/doc/files/lib/SourceFileInfo_rb.html +106 -0
- data/doc/files/lib/SyntaxReference_rb.html +122 -0
- data/doc/files/lib/TOCEntry_rb.html +118 -0
- data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
- data/doc/files/lib/TableOfContents_rb.html +118 -0
- data/doc/files/lib/TaskDependency_rb.html +106 -0
- data/doc/files/lib/TaskJuggler_rb.html +120 -0
- data/doc/files/lib/TaskScenario_rb.html +116 -0
- data/doc/files/lib/Task_rb.html +118 -0
- data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
- data/doc/files/lib/TextParser/Rule_rb.html +106 -0
- data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
- data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
- data/doc/files/lib/TextParser_rb.html +124 -0
- data/doc/files/lib/TextScanner_rb.html +128 -0
- data/doc/files/lib/Tj3Config_rb.html +118 -0
- data/doc/files/lib/TjException_rb.html +106 -0
- data/doc/files/lib/TjTime_rb.html +118 -0
- data/doc/files/lib/TjpExample_rb.html +116 -0
- data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
- data/doc/files/lib/UTF8String_rb.html +132 -0
- data/doc/files/lib/UserManual_rb.html +124 -0
- data/doc/files/lib/WorkingHours_rb.html +116 -0
- data/doc/files/lib/XMLDocument_rb.html +116 -0
- data/doc/files/lib/XMLElement_rb.html +116 -0
- data/doc/files/lib/reports/CSVFile_rb.html +116 -0
- data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
- data/doc/files/lib/reports/GanttChart_rb.html +122 -0
- data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
- data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
- data/doc/files/lib/reports/GanttLine_rb.html +126 -0
- data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
- data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
- data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
- data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
- data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
- data/doc/files/lib/reports/ReportElement_rb.html +118 -0
- data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
- data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
- data/doc/files/lib/reports/ReportTable_rb.html +118 -0
- data/doc/files/lib/reports/Report_rb.html +126 -0
- data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
- data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
- data/doc/files/lib/taskjuggler3_rb.html +276 -0
- data/doc/files/lib/tj3man_rb.html +189 -0
- data/doc/fr_class_index.html +285 -0
- data/doc/fr_file_index.html +223 -0
- data/doc/fr_method_index.html +1953 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples/tutorial.tjp +361 -0
- data/gem_spec.rb +30 -0
- data/lib/Account.rb +50 -0
- data/lib/AccountScenario.rb +39 -0
- data/lib/Allocation.rb +102 -0
- data/lib/AppConfig.rb +134 -0
- data/lib/AttributeBase.rb +131 -0
- data/lib/AttributeDefinition.rb +47 -0
- data/lib/Attributes.rb +478 -0
- data/lib/BatchProcessor.rb +209 -0
- data/lib/Booking.rb +59 -0
- data/lib/Charge.rb +71 -0
- data/lib/ChargeSet.rb +126 -0
- data/lib/HTMLDocument.rb +59 -0
- data/lib/Interval.rb +127 -0
- data/lib/KeywordDocumentation.rb +560 -0
- data/lib/Limits.rb +219 -0
- data/lib/Log.rb +160 -0
- data/lib/LogicalExpression.rb +71 -0
- data/lib/LogicalFlag.rb +34 -0
- data/lib/LogicalFunction.rb +102 -0
- data/lib/LogicalOperation.rb +118 -0
- data/lib/MacroParser.rb +77 -0
- data/lib/MacroTable.rb +84 -0
- data/lib/Message.rb +56 -0
- data/lib/MessageHandler.rb +34 -0
- data/lib/Project.rb +662 -0
- data/lib/ProjectFileParser.rb +333 -0
- data/lib/PropertyList.rb +181 -0
- data/lib/PropertySet.rb +304 -0
- data/lib/PropertyTreeNode.rb +461 -0
- data/lib/Query.rb +227 -0
- data/lib/RealFormat.rb +73 -0
- data/lib/Resource.rb +42 -0
- data/lib/ResourceScenario.rb +511 -0
- data/lib/RichText.rb +147 -0
- data/lib/RichTextDocument.rb +139 -0
- data/lib/RichTextElement.rb +391 -0
- data/lib/RichTextParser.rb +66 -0
- data/lib/RichTextProtocolExample.rb +65 -0
- data/lib/RichTextProtocolHandler.rb +35 -0
- data/lib/RichTextScanner.rb +390 -0
- data/lib/RichTextSnip.rb +104 -0
- data/lib/RichTextSyntaxRules.rb +265 -0
- data/lib/Scenario.rb +27 -0
- data/lib/ScenarioData.rb +65 -0
- data/lib/Scoreboard.rb +141 -0
- data/lib/Shift.rb +48 -0
- data/lib/ShiftAssignments.rb +291 -0
- data/lib/ShiftScenario.rb +46 -0
- data/lib/SourceFileInfo.rb +37 -0
- data/lib/SyntaxReference.rb +284 -0
- data/lib/TOCEntry.rb +76 -0
- data/lib/TableColumnDefinition.rb +54 -0
- data/lib/TableOfContents.rb +46 -0
- data/lib/Task.rb +37 -0
- data/lib/TaskDependency.rb +39 -0
- data/lib/TaskJuggler.rb +84 -0
- data/lib/TaskScenario.rb +1622 -0
- data/lib/TextParser.rb +416 -0
- data/lib/TextParser/Pattern.rb +263 -0
- data/lib/TextParser/Rule.rb +171 -0
- data/lib/TextParser/StackElement.rb +45 -0
- data/lib/TextParser/TokenDoc.rb +38 -0
- data/lib/TextScanner.rb +682 -0
- data/lib/Tj3Config.rb +27 -0
- data/lib/TjException.rb +27 -0
- data/lib/TjTime.rb +395 -0
- data/lib/TjpExample.rb +119 -0
- data/lib/TjpSyntaxRules.rb +4022 -0
- data/lib/UTF8String.rb +100 -0
- data/lib/UserManual.rb +282 -0
- data/lib/WorkingHours.rb +323 -0
- data/lib/XMLDocument.rb +54 -0
- data/lib/XMLElement.rb +175 -0
- data/lib/reports/CSVFile.rb +146 -0
- data/lib/reports/ColumnTable.rb +66 -0
- data/lib/reports/GanttChart.rb +308 -0
- data/lib/reports/GanttContainer.rb +107 -0
- data/lib/reports/GanttHeader.rb +141 -0
- data/lib/reports/GanttHeaderScaleItem.rb +42 -0
- data/lib/reports/GanttLine.rb +329 -0
- data/lib/reports/GanttLoadStack.rb +113 -0
- data/lib/reports/GanttMilestone.rb +80 -0
- data/lib/reports/GanttRouter.rb +375 -0
- data/lib/reports/GanttTaskBar.rb +95 -0
- data/lib/reports/HTMLGraphics.rb +65 -0
- data/lib/reports/Report.rb +344 -0
- data/lib/reports/ReportElement.rb +427 -0
- data/lib/reports/ReportTable.rb +144 -0
- data/lib/reports/ReportTableCell.rb +142 -0
- data/lib/reports/ReportTableColumn.rb +82 -0
- data/lib/reports/ReportTableElement.rb +852 -0
- data/lib/reports/ReportTableLegend.rb +167 -0
- data/lib/reports/ReportTableLine.rb +87 -0
- data/lib/reports/ResourceListRE.rb +72 -0
- data/lib/reports/TaskListRE.rb +73 -0
- data/lib/reports/TjpExportRE.rb +394 -0
- data/lib/taskjuggler3.rb +106 -0
- data/lib/tj3man.rb +88 -0
- data/manual/Day_To_Day_Juggling +168 -0
- data/manual/Getting_Started +61 -0
- data/manual/How_To_Contribute +185 -0
- data/manual/Installation +68 -0
- data/manual/Intro +102 -0
- data/manual/Reporting_Bugs +26 -0
- data/manual/Rich_Text_Attributes +90 -0
- data/manual/TaskJuggler_2x_Migration +40 -0
- data/manual/Tutorial +579 -0
- data/manual/fdl +450 -0
- data/prj_cfg.rb +43 -0
- data/setup.rb +1585 -0
- data/tasks/csts.rake +72 -0
- data/tasks/gem.rake +14 -0
- data/tasks/manual.rake +10 -0
- data/tasks/missing.rake +21 -0
- data/tasks/rcov.rake +14 -0
- data/tasks/rdoc.rake +17 -0
- data/tasks/rexml_fix.rb +16 -0
- data/tasks/rexml_fix_19.rb +49 -0
- data/tasks/show.rake +21 -0
- data/tasks/stats.rake +25 -0
- data/tasks/test.rake +11 -0
- data/test/MessageChecker.rb +53 -0
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
- data/test/TestSuite/CSV-Reports/genrefs +6 -0
- data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
- data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
- data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
- data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
- data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
- data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
- data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
- data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
- data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
- data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
- data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
- data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
- data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
- data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
- data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
- data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
- data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
- data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
- data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
- data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
- data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
- data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
- data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
- data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
- data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
- data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
- data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/csvtest +16 -0
- data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
- data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
- data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
- data/test/all.rb +31 -0
- data/test/test_BatchProcessor.rb +54 -0
- data/test/test_CSV-Reports.rb +101 -0
- data/test/test_Limits.rb +104 -0
- data/test/test_LogicalExpression.rb +110 -0
- data/test/test_MacroTable.rb +51 -0
- data/test/test_Project.rb +57 -0
- data/test/test_PropertySet.rb +71 -0
- data/test/test_Query.rb +83 -0
- data/test/test_RealFormat.rb +83 -0
- data/test/test_RichText.rb +869 -0
- data/test/test_Scheduler.rb +42 -0
- data/test/test_ShiftAssignments.rb +77 -0
- data/test/test_Syntax.rb +41 -0
- data/test/test_TextScanner.rb +95 -0
- data/test/test_TjTime.rb +114 -0
- data/test/test_TjpExample.rb +169 -0
- data/test/test_UTF8String.rb +84 -0
- data/test/test_WorkingHours.rb +56 -0
- metadata +649 -0
data/lib/HTMLDocument.rb
ADDED
|
@@ -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
|
+
|
data/lib/Interval.rb
ADDED
|
@@ -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
|
+
|