dokkit 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +125 -0
  3. data/README.txt +53 -0
  4. data/Rakefile +25 -167
  5. data/bin/dokkit +4 -60
  6. data/lib/dokkit/app.rb +63 -192
  7. data/lib/dokkit/builtintask.rb +85 -0
  8. data/lib/dokkit/cachemanager.rb +61 -0
  9. data/lib/dokkit/cleantask.rb +51 -0
  10. data/lib/dokkit/consolelog.rb +42 -0
  11. data/lib/dokkit/defaults.rb +19 -0
  12. data/lib/dokkit/document.rb +221 -0
  13. data/lib/dokkit/dokkitlib.rb +68 -0
  14. data/lib/dokkit/extension/extension.rb +15 -0
  15. data/lib/dokkit/extension/filehelper.rb +25 -0
  16. data/lib/dokkit/fileselection.rb +44 -0
  17. data/lib/dokkit/filters/all.rb +18 -0
  18. data/lib/dokkit/filters/base.rb +18 -0
  19. data/lib/dokkit/filters/deplate.rb +21 -25
  20. data/lib/dokkit/filters/maruku.rb +23 -0
  21. data/lib/dokkit/filters/nil.rb +23 -0
  22. data/lib/dokkit/filters.rb +29 -21
  23. data/lib/dokkit/logger.rb +73 -0
  24. data/lib/dokkit/model.rb +34 -0
  25. data/lib/dokkit/models/{Rakefile.tpl → simpledocument/model/Rakefile} +15 -2
  26. data/lib/dokkit/models/simpledocument/model/doc/configs/simpledocument.yaml +3 -0
  27. data/lib/dokkit/models/simpledocument/model/doc/layouts/simpledocument.html +9 -0
  28. data/lib/dokkit/models/simpledocument/model/doc/layouts/simpledocument.latex +8 -0
  29. data/lib/dokkit/models/simpledocument/model/doc/layouts/simpledocument.text +1 -0
  30. data/lib/dokkit/models/simpledocument/model/doc/pages/simpledocument.deplate +102 -0
  31. data/lib/dokkit/models/simpledocument/model/tasks/all.rb +3 -0
  32. data/lib/dokkit/models/simpledocument/model/tasks/clean.rake +3 -0
  33. data/lib/dokkit/models/simpledocument/model/tasks/render.rake +8 -0
  34. data/lib/dokkit/models/simpledocument/model/tasks/setup.rb +9 -0
  35. data/lib/dokkit/modeltask.rb +83 -0
  36. data/lib/dokkit/pathhelper.rb +46 -0
  37. data/lib/dokkit/recursivemerge.rb +59 -0
  38. data/lib/dokkit/rendertask.rb +101 -0
  39. data/lib/dokkit/resourcemanager.rb +177 -0
  40. data/lib/dokkit/taskconfig.rb +39 -0
  41. data/lib/dokkit/templatetask.rb +37 -0
  42. data/lib/dokkit.rb +2 -8
  43. data/spec/app_spec.rb +55 -0
  44. data/spec/builtintask_spec.rb +114 -0
  45. data/spec/cachemanager_spec.rb +107 -0
  46. data/spec/cleantask_spec.rb +72 -0
  47. data/spec/consolelog_spec.rb +69 -0
  48. data/{tests/data/projects/simple-document → spec/data/test_build}/Rakefile +8 -8
  49. data/spec/data/test_build/doc/configs/document_1.yaml +3 -0
  50. data/spec/data/test_build/doc/configs/required.yaml +3 -0
  51. data/spec/data/test_build/doc/configs/subdir/document_4.yaml +3 -0
  52. data/spec/data/test_build/doc/layouts/document_1.html +9 -0
  53. data/spec/data/test_build/doc/layouts/document_1.latex +8 -0
  54. data/spec/data/test_build/doc/layouts/document_with_partials.html +9 -0
  55. data/spec/data/test_build/doc/layouts/layout +0 -0
  56. data/spec/data/test_build/doc/layouts/layout.html +8 -0
  57. data/spec/data/test_build/doc/layouts/layout.html.backup +8 -0
  58. data/spec/data/test_build/doc/layouts/nested.html +3 -0
  59. data/spec/data/test_build/doc/layouts/partials/partial.html +4 -0
  60. data/spec/data/test_build/doc/pages/COMMON.yaml +6 -0
  61. data/spec/data/test_build/doc/pages/document_1 +20 -0
  62. data/spec/data/test_build/doc/pages/document_1.dep +4 -0
  63. data/spec/data/test_build/doc/pages/document_1.yaml +11 -0
  64. data/spec/data/test_build/doc/pages/document_2 +9 -0
  65. data/spec/data/test_build/doc/pages/document_2.dep +0 -0
  66. data/spec/data/test_build/doc/pages/document_2.yaml +6 -0
  67. data/spec/data/test_build/doc/pages/document_3 +13 -0
  68. data/spec/data/test_build/doc/pages/document_5.exclude +0 -0
  69. data/spec/data/test_build/doc/pages/document_7 +4 -0
  70. data/spec/data/test_build/doc/pages/document_7.yaml +5 -0
  71. data/spec/data/test_build/doc/pages/document_extended +1 -0
  72. data/spec/data/test_build/doc/pages/document_nested +6 -0
  73. data/spec/data/test_build/doc/pages/document_nested.yaml +5 -0
  74. data/spec/data/test_build/doc/pages/document_nolayout.ext +3 -0
  75. data/spec/data/test_build/doc/pages/document_nolayout.yaml +2 -0
  76. data/spec/data/test_build/doc/pages/document_with_partials +3 -0
  77. data/spec/data/test_build/doc/pages/document_with_partials.yaml +2 -0
  78. data/spec/data/test_build/doc/pages/partials/COMMON.yaml +5 -0
  79. data/spec/data/test_build/doc/pages/partials/circular_partial +2 -0
  80. data/spec/data/test_build/doc/pages/partials/circular_partial.yaml +3 -0
  81. data/spec/data/test_build/doc/pages/partials/partial +2 -0
  82. data/spec/data/test_build/doc/pages/subdir/COMMON.yaml +2 -0
  83. data/spec/data/test_build/doc/pages/subdir/document_4 +11 -0
  84. data/spec/data/test_build/doc/pages/subdir/subdir/COMMON.yaml +2 -0
  85. data/spec/data/test_build/doc/pages/subdir/subdir/document_6 +3 -0
  86. data/spec/data/test_build/tasks/all.rb +3 -0
  87. data/spec/data/test_build/tasks/clean.rake +3 -0
  88. data/spec/data/test_build/tasks/render.rake +8 -0
  89. data/spec/data/test_build/tasks/setup.rb +9 -0
  90. data/spec/data/test_build/tasks/template.rake +3 -0
  91. data/spec/data/test_build/templates/layouts/layout +0 -0
  92. data/spec/data/test_build/templates/pages/template +0 -0
  93. data/spec/document_spec.rb +321 -0
  94. data/spec/dokkitlib_spec.rb +63 -0
  95. data/spec/filehelper_spec.rb +34 -0
  96. data/spec/fileselection_spec.rb +101 -0
  97. data/spec/filter_base_spec.rb +29 -0
  98. data/spec/filter_deplate_spec.rb +48 -0
  99. data/spec/filter_maruku_spec.rb +29 -0
  100. data/spec/filter_nil_spec.rb +30 -0
  101. data/spec/filters_spec.rb +37 -0
  102. data/spec/logger_spec.rb +150 -0
  103. data/spec/model_spec.rb +45 -0
  104. data/spec/pathhelper_spec.rb +62 -0
  105. data/spec/recursivemerge_spec.rb +91 -0
  106. data/spec/rendertask_spec.rb +374 -0
  107. data/spec/spec_helper.rb +61 -0
  108. data/spec/taskconfig_spec.rb +45 -0
  109. data/spec/templatetask_spec.rb +72 -0
  110. data/tasks/annotations.rake +30 -0
  111. data/tasks/doc.rake +49 -0
  112. data/tasks/gem.rake +89 -0
  113. data/tasks/manifest.rake +41 -0
  114. data/tasks/rubyforge.rake +57 -0
  115. data/tasks/setup.rb +151 -0
  116. data/tasks/spec.rake +40 -0
  117. data/tasks/svn.rake +44 -0
  118. data/tasks/test.rake +40 -0
  119. metadata +188 -161
  120. data/CHANGES +0 -26
  121. data/LICENSE +0 -674
  122. data/README +0 -32
  123. data/lib/dokkit/#render_task_factory.rb# +0 -94
  124. data/lib/dokkit/dokkittasks.rb +0 -99
  125. data/lib/dokkit/hash.rb +0 -41
  126. data/lib/dokkit/models/share/builtin.rf +0 -28
  127. data/lib/dokkit/page.rb +0 -195
  128. data/lib/dokkit/render_task_factory.rb +0 -91
  129. data/tests/data/output/simple_document/README +0 -57
  130. data/tests/data/output/simple_document/Rakefile +0 -7
  131. data/tests/data/output/simple_document/doc/config/simple_document.yaml +0 -5
  132. data/tests/data/output/simple_document/doc/pages/simple_document.dpl +0 -12
  133. data/tests/data/output/website_project/README +0 -49
  134. data/tests/data/output/website_project/Rakefile +0 -82
  135. data/tests/data/output/website_project/doc/layouts/normal.thtml +0 -38
  136. data/tests/data/output/website_project/doc/pages/COMMON.rb +0 -9
  137. data/tests/data/output/website_project/doc/pages/deplate.dplhtml +0 -9
  138. data/tests/data/output/website_project/doc/pages/index.rb +0 -10
  139. data/tests/data/output/website_project/doc/pages/index.thtml +0 -12
  140. data/tests/data/output/website_project/doc/res/images/rote-tiny.png +0 -0
  141. data/tests/data/projects/simple-document/README +0 -57
  142. data/tests/data/projects/simple-document/doc/config/author.yaml +0 -4
  143. data/tests/data/projects/simple-document/doc/config/model.yaml +0 -18
  144. data/tests/data/projects/simple-document/doc/config/simple_document.yaml +0 -6
  145. data/tests/data/projects/simple-document/doc/layouts/another_simple_document.html +0 -8
  146. data/tests/data/projects/simple-document/doc/layouts/another_simple_document.tex +0 -10
  147. data/tests/data/projects/simple-document/doc/layouts/layout_with_custom_name.html +0 -8
  148. data/tests/data/projects/simple-document/doc/layouts/semantic.cache +0 -23
  149. data/tests/data/projects/simple-document/doc/pages/COMMON.yaml +0 -23
  150. data/tests/data/projects/simple-document/doc/pages/another_simple_document.dpl +0 -12
  151. data/tests/data/projects/simple-document/doc/pages/simple_document.dpl +0 -12
  152. data/tests/data/projects/simple-document/doc/pages/simple_document_without_layout.dpl +0 -12
  153. data/tests/data/projects/simple-document/doc/pages/subdir/COMMON.yaml +0 -4
  154. data/tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.dpl +0 -12
  155. data/tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.yaml +0 -3
  156. data/tests/data/projects/simple-document/doc/pages/subdir/subdir/COMMON.yaml +0 -2
  157. data/tests/data/projects/simple-document/doc/pages/subdir/subdir/another_simple_document_in_subdir.dpl +0 -12
  158. data/tests/data/projects/simple-document/doc/pages/yet_another_simple_document.dpl +0 -12
  159. data/tests/data/projects/simple-document/doc/pages/yet_another_simple_document.yaml +0 -8
  160. data/tests/gem_tests.rb +0 -4
  161. data/tests/spec_page.rb +0 -25
  162. data/tests/test.rb +0 -2
  163. data/tests/test_application.rb +0 -40
  164. data/tests/test_builtin_tasks.rb +0 -37
  165. data/tests/test_config.rb +0 -108
  166. data/tests/test_core.rb +0 -12
  167. data/tests/test_dokkit_commandline.rb +0 -18
  168. data/tests/test_exception.rb +0 -7
  169. data/tests/test_filters.rb +0 -46
  170. data/tests/test_layout.rb +0 -64
  171. data/tests/test_options.rb +0 -33
  172. data/tests/test_project_tasks.rb +0 -48
  173. data/tests/test_recursive_merge.rb +0 -42
  174. data/tests/test_task_factory.rb +0 -38
  175. /data/{CONTRIBUTORS → lib/dokkit/models/simpledocument/model/doc/data/css/style.css} +0 -0
  176. /data/{DONE → spec/data/test_build/doc/data/resource} +0 -0
  177. /data/{TODO → spec/data/test_build/doc/data/resource.exclude} +0 -0
  178. /data/{tests/pages/test.dpltex → spec/data/test_build/doc/data/subdir/resource.insubdir} +0 -0
@@ -1,49 +0,0 @@
1
- This is the auto-generated Rote documentation source.
2
-
3
- To render it using Rote's command-line wrapper (ignoring the included
4
- Rakefile), type:
5
-
6
- rote doc
7
-
8
- from the top-level directory (this one).
9
-
10
- To render using the included Rakefile (the result is the same in either
11
- case) type instead:
12
-
13
- rake doc
14
-
15
- If you prefer, you can omit the 'doc' task, since it is configured
16
- as the default.
17
-
18
- In either case, you should see some output as the pages are rendered
19
- and resources copied, and get output in a (created) 'html' directory.
20
- Once you have rendered the site, running the command again will appear
21
- to do nothing, because only changed resources are re-rendered. To
22
- start over:
23
-
24
- (rote|rake) clobber
25
-
26
- Alternatively, modify the page or resource files, and rerun the first
27
- command to transform only the modified resource.
28
-
29
- WHAT NEXT?
30
-
31
- + See what else you can do by typing:
32
-
33
- (rote|rake) --tasks
34
-
35
- rote --usage ( with the command-line wrapper )
36
-
37
- + Modify the included page template and layout to suit your needs.
38
-
39
- + Edit the included Rakefile to add or change tasks, or delete it
40
- if you're sticking with the command-line wrapper.
41
-
42
- + Add more pages and layouts.
43
-
44
- + Start Rote in monitor mode, and have your changes rendered as
45
- you work:
46
-
47
- (rote|rake) doc_monitor
48
-
49
-
@@ -1,82 +0,0 @@
1
- # Standard Rakefile for custom Rote build
2
- #
3
- # Generated from:
4
- # $Id: Rakefile 160 2006-01-05 21:05:44Z roscopeco $
5
- #
6
- begin
7
- require 'rubygems'
8
- rescue LoadError
9
- nil # optional
10
- end
11
-
12
- require 'rake'
13
- require 'rake/clean'
14
- require 'rote/format'
15
- require 'dokkit'
16
- require 'dokkit/filters'
17
-
18
- include Rote
19
- include Dokkit
20
-
21
- # Create a set of tasks with the prefix 'doc' to build the
22
- # documentation set. The directory layout is as for the
23
- # command-line wrapper (but can be changed of course).
24
- #
25
- # This creates the following tasks:
26
- #
27
- # * doc - transform/copy all modified pages / resources
28
- # * doc_pages - transform all modified pages
29
- # * doc_res - copy all modified resources
30
- # * doc_monitor - Start monitor mode, transform changed files automatically
31
- #
32
- # * [html/**/*] - Transform single page / resource unconditionally
33
- #
34
- # * clobber_doc - Remove output (hooks into main 'clobber' task)
35
- #
36
- # In addition to these tasks, you may also wish to define a 'doc_refresh' task
37
- # to be run whenever modified resources are processed in monitor mode.
38
- ws = Rote::DocTask.new(:doc) do |site|
39
- site.output_dir = 'html'
40
- site.layout_dir = 'doc/layouts'
41
- site.config_dir = 'doc/config'
42
-
43
- site.pages.dir = 'doc/pages'
44
- site.pages.include('**/*')
45
-
46
- site.res.dir = 'doc/res'
47
- site.res.include('**/*')
48
-
49
- site.ext_mapping(/thtml|textile/, 'html') do |page|
50
- page.extend Format::HTML
51
- page.page_filter Rote::Filters::RedCloth.new
52
- end
53
-
54
- site.ext_mapping(/mhtml|markdown/, 'html') do |page|
55
- page.extend Format::HTML
56
- page.page_filter Rote::Filters::BlueCloth.new
57
- end
58
-
59
- site.ext_mapping(/rdhtml|rdoc/, 'html') do |page|
60
- page.extend Format::HTML
61
- page.page_filter Rote::Filters::RDoc.new
62
- end
63
-
64
- site.ext_mapping(/dplhtml/, 'html') do |page|
65
- page.extend Format::HTML
66
- page.page_filter Dokkit::Filters::Deplate.new('html-notemplate')
67
- end
68
-
69
- site.ext_mapping(/html/, 'html') do |page|
70
- page.extend Format::HTML
71
- end
72
- end
73
-
74
- task :default => [:doc]
75
-
76
- # import user-level tasks
77
- import "#{ENV['HOME']}/.rotetasks.rf" if File.exists?("#{ENV['HOME']}/.rotetasks.rf")
78
- import 'local.rf' if File.exists?('local.rf')
79
-
80
- # TODO Define your custom tasks here
81
-
82
-
@@ -1,38 +0,0 @@
1
- <%
2
- # This is the 'normal' layout. It can be selected with:
3
- #
4
- # layout 'normal'
5
- #
6
- # in page code. If the page itself doesn't have an '.html'
7
- # extension, you will need to use:
8
- #
9
- # layout 'normal.html'
10
- #
11
- # instead.
12
- #
13
- # Here we just add basic HTML wrap-up, use the custom var
14
- # (@page_title) to get the title, and insert content where
15
- # we want it with @content_for_layout.
16
- %>
17
- <html>
18
- <head>
19
- <%# Use our custom vars for the title %>
20
- <title><%= @page_title + ' - ' + @site_title %></title>
21
- </head>
22
-
23
- <body>
24
- <h1><%= @page_title %></h1>
25
-
26
- <%# Insert page content #%>
27
- <%= @content_for_layout %>
28
-
29
- <p align='center'><hr width='80%'></p>
30
- <p align='right'>
31
- <span style='font-size: 8pt; color: #7c7c90'>Generated with</span><br/>
32
-
33
- <%# use the link_rel helper to make absolute links relative to current page #%>
34
- <a href='http://rote.rubyforge.org/' target='_blank'><img src='<%= link_rel '/images/rote-tiny.png' %>' alt='Rote'/></a>
35
- </p>
36
- </body>
37
- </html>
38
-
@@ -1,9 +0,0 @@
1
- # Shared code for all pages below this directory.
2
- #
3
- # This is executed for every file transformed, in the binding of
4
- # the appropriate Rote::Page instance. Individual page sources
5
- # ([pagename].rb) override anything defined here.
6
- #
7
- # Any COMMON.rb files found in directories above this will also
8
- # be loaded.
9
- @site_title = "My site"
@@ -1,9 +0,0 @@
1
- #LIST: toc
2
-
3
- * Introduzione
4
-
5
- Lista:
6
-
7
- - item 1
8
- - item 2
9
-
@@ -1,10 +0,0 @@
1
- # Page code for the 'index' page. We call a few methods to
2
- # set layout and formatting, and then create a custom variable
3
- # for use in the layout.
4
-
5
- # Apply the 'normal' layout
6
- layout 'normal'
7
-
8
- # Set a custom var for use in our layout
9
- @page_title = 'A sample page'
10
-
@@ -1,12 +0,0 @@
1
- This is a *sample* page.
2
-
3
- <%# insert an image with relative path, using Textile !img! markup #%>
4
- It has a very small image:
5
- !<%= link_rel '/images/rote-tiny.png' %>!
6
-
7
- (Which is the same as the one at the bottom)
8
-
9
- * You should
10
- * Replace this
11
- * With your doc.
12
-
@@ -1,57 +0,0 @@
1
- This is 'simple_document' a simple document model included in the core
2
- distribution of dokkit. Check http://rubyforge.org/dokkit/ for other
3
- models.
4
-
5
- To modify this document simply edit 'doc/pages/simple_document.dpl'. To get further
6
- information about the wiki syntax to be used please check http://deplate.sf.net/
7
-
8
- To render this document in html, type:
9
-
10
- dokkit render_html
11
-
12
- from any subdirectory contained in the top-level directory (this one).
13
-
14
- To render this document in TeX, type:
15
-
16
- dokkit render_tex
17
-
18
- In either case, you should get the output in a (created) 'output'
19
- directory:
20
-
21
- in 'output/html' you get html output
22
- in 'output/tex' you get tex output
23
-
24
- ... and so on...
25
-
26
- Once you have rendered the document, running the command again will appear
27
- to do nothing, because only changed resources are re-rendered. To
28
- clean the output and start over:
29
-
30
- dokkit clobber
31
-
32
- Alternatively, modify the page or resource files, and rerun
33
-
34
- dokkit render_html
35
-
36
- or
37
-
38
- dokkit render_tex
39
-
40
- to transform only the modified resource.
41
-
42
- * WHAT'S NEXT?
43
-
44
- - See what else you can do by typing:
45
-
46
- dokkit --tasks
47
-
48
- - Modify the configuration of the document by editing
49
- 'doc/config/simple_document.yaml'
50
-
51
- - Create a new document by typing:
52
-
53
- dokkit create_new_page new_document
54
-
55
- For further information about dokkit see http://dokkit.rubyforge.org/
56
-
57
-
@@ -1,4 +0,0 @@
1
- document:
2
- author:
3
- email: john.doe@organization.org
4
-
@@ -1,18 +0,0 @@
1
- #----------------------------------------------------------------------
2
- #
3
- # model.yaml created on 19 set 2007 at 22:37:25.
4
- # See 'dokkit.rb' or LICENSE for licence information.
5
- #
6
- # (c)2007 Andrea Fazzi (and contributors).
7
- #
8
- # This is a config file for the current document. This file is written
9
- # using YAML so you can easily modify it using YAML syntax. For further
10
- # information about YAML please visit http://yaml.org.
11
- #
12
- #----------------------------------------------------------------------
13
-
14
- model:
15
- name: simpledocument
16
- version: 0.1.0
17
- language: en
18
-
@@ -1,6 +0,0 @@
1
- document:
2
- title: A simple document
3
- author: John Doe
4
-
5
-
6
-
@@ -1,8 +0,0 @@
1
- <html> <!-- Custom layout for simple_document -->
2
- <head>
3
- <title><%= @config['document']['title'] %></title>
4
- </head>
5
- <body>
6
- <%= @content_for_layout %>
7
- </body>
8
- </html>
@@ -1,10 +0,0 @@
1
- \documentclass[a4paper,10pt]{article} % custom layout for simple_document
2
-
3
- \title{<%= @config['title'] %>}
4
- \author{<%= @config['author'] %>
5
-
6
- \begin{document}
7
-
8
- <%= @content_for_layout %>
9
-
10
- \end{document}
@@ -1,8 +0,0 @@
1
- <html> <!-- Custom layout with custom name for simple_document -->
2
- <head>
3
- <title><%= @config['document']['title'] %></title>
4
- </head>
5
- <body>
6
- <%= @content_for_layout %>
7
- </body>
8
- </html>
@@ -1,23 +0,0 @@
1
- ;; Object layouts/
2
- ;; SEMANTICDB Tags save file
3
- (semanticdb-project-database-file "layouts/"
4
- :tables (list
5
- (semanticdb-table "layout_with_custom_name.html"
6
- :major-mode 'html-mode
7
- :tags '(("" section nil nil [81 142]) ("" section nil nil [142 147]))
8
- :file "layout_with_custom_name.html"
9
- :pointmax 194
10
- :unmatched-syntax 'nil
11
- )
12
- (semanticdb-table "another_simple_document.html"
13
- :major-mode 'html-mode
14
- :tags '(("" section nil nil [64 125]) ("" section nil nil [125 130]))
15
- :file "another_simple_document.html"
16
- :pointmax 177
17
- :unmatched-syntax 'nil
18
- )
19
- )
20
- :file "semantic.cache"
21
- :semantic-tag-version "2.0pre3"
22
- :semanticdb-version "2.0pre3"
23
- )
@@ -1,23 +0,0 @@
1
- #-------------------------------------------------------------------------
2
- #
3
- # COMMON.yaml created on 01 ott 2007 at 15:21:20.
4
- # See 'dokkit.rb' or LICENSE for licence information.
5
- #
6
- # (c)2006, 2007 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors).
7
- #
8
- # This is a config file for the current document. This file is written
9
- # using YAML so you can easily modify it using YAML syntax. For further
10
- # information about YAML please visit http://yaml.org/.
11
- #
12
- #-------------------------------------------------------------------------
13
-
14
- document:
15
- title: A common title for document in pages dir
16
- author:
17
- name: John
18
- surname: Doe
19
- common_key: A common value for documents in pages dir
20
-
21
-
22
-
23
-
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,4 +0,0 @@
1
- document:
2
- title: A simple document in a subdirectory
3
- common_key: A common value for documents in subdir
4
-
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,2 +0,0 @@
1
- document:
2
- common_key: A common value for documents in subdir/subdir
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,12 +0,0 @@
1
- * Abstract
2
- From a document of Jim{cite: author:jim}
3
-
4
- * Introduction
5
-
6
- * Main section
7
-
8
- ** Subsection One
9
- ** Subsection Two
10
-
11
- * Conclusions
12
-
@@ -1,8 +0,0 @@
1
- document:
2
- layout: layout_with_custom_name
3
- title: A simple document with layout with custom name
4
- config: []
5
- - author
6
- - notexists
7
-
8
-
data/tests/gem_tests.rb DELETED
@@ -1,4 +0,0 @@
1
- TEST_FROM_GEM = true
2
- $: << File.join(File.dirname(__FILE__),'../lib')
3
- Dir[File.join(File.dirname(__FILE__), '**/test_*.rb')].each { |test| require test }
4
-
data/tests/spec_page.rb DELETED
@@ -1,25 +0,0 @@
1
- require 'rubygems'
2
- require 'spec'
3
- require 'dokkit'
4
-
5
- context 'A new page' do
6
-
7
- setup do
8
- @config_page_complete = { :fn => 'test.dpltex',
9
- :layout_dir => 'layouts/',
10
- :pages_dir => 'pages/',
11
- :config_dir => 'config'
12
- }
13
-
14
- @config_page_incomplete = { :fn => 'test.dpltex', :pages_dir => 'pages/' }
15
- end
16
-
17
- specify 'should be correctly initialized if fn, layout_dir, pages_dir and config_dir are given' do
18
- Rote::Page.new(@config_page_complete)
19
- end
20
-
21
- specify 'should have correct defaults for pages_dir, layout_dir and config_dir' do
22
- Rote::Page.new(@config_page_incomplete)
23
- end
24
-
25
- end
data/tests/test.rb DELETED
@@ -1,2 +0,0 @@
1
- break test_builtin_tasks.rb:45
2
- break app.rb:211
@@ -1,40 +0,0 @@
1
- #
2
- # File 'test_application.rb' created on 22 Oct 2007 at 16:25:05.
3
- # See 'dokkit.rb' or +LICENSE+ for licence information.
4
- #
5
- # (c)2006, 2007 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors).
6
- #
7
- # To execute this unit test run:
8
- #
9
- # ruby test/test_application.rb
10
- #
11
-
12
- require 'rubygems'
13
- require 'test/unit'
14
- require 'dokkit'
15
- require 'dokkit/app'
16
-
17
- $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__),'../lib'))
18
-
19
- class TestApplication < Test::Unit::TestCase
20
- def setup
21
- end
22
- def teardown
23
- end
24
- # The tests below need dokkit-model-simple-document gem to pass.
25
- # Run:
26
- # $ gem install dokkit-model-simpledocument
27
- # to install the simpledocument model.
28
- def test_fetch_models
29
- assert(File.exists?(Dokkit.fetch_models['simple-document']))
30
- end
31
- def test_model_dir
32
- assert(File.exists?(Dokkit.model_dir('simple-document')))
33
- end
34
- def test_model_layout_dir
35
- assert(File.exists?(Dokkit.model_layout_dir('simple-document')))
36
- end
37
- def test_config_dir
38
- assert(File.exists?(Dokkit.model_config_dir('simple-document')))
39
- end
40
- end
@@ -1,37 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'dokkit'
4
- require 'dokkit/app'
5
- require 'rake'
6
-
7
-
8
- $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__),'../lib'))
9
-
10
- class TestBuiltinTask < Test::Unit::TestCase
11
- OUTPUT_DIR = 'tests/data/output'
12
- def setup
13
- ARGV.clear
14
- end
15
- def test_builtin_task
16
- Dokkit.application.init
17
- Dokkit.application.define_builtin_tasks
18
- assert_equal('create', Dokkit.application['create'].to_s)
19
- end
20
- def test_create_default_project_task
21
- Dokkit.application.init
22
- Dokkit.application.define_builtin_tasks
23
- ARGV.push("create", "#{OUTPUT_DIR}/simple_document")
24
- Dokkit.application.run
25
- dir_content = Dir["#{OUTPUT_DIR}/simple_document/*"]
26
- assert(!dir_content.empty? && !dir_content.include?('lib'))
27
- end
28
- def test_create_website_task
29
- Dokkit.application.init
30
- Dokkit.application.do_option('--project',"website")
31
- Dokkit.application.define_builtin_tasks
32
- ARGV.push("create", "#{OUTPUT_DIR}/website_project")
33
- Dokkit.application.run
34
- assert(Dir["#{OUTPUT_DIR}/website_project/*"].size > 1)
35
- end
36
- end
37
-