dokkit 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +15 -1
- data/LICENSE +673 -19
- data/README +32 -0
- data/Rakefile +59 -25
- data/bin/dokkit +48 -38
- data/lib/dokkit/#render_task_factory.rb# +94 -0
- data/lib/dokkit/app.rb +212 -257
- data/lib/dokkit/deplate/fmt/latex-notemplate.rb +3 -1
- data/lib/dokkit/dokkittasks.rb +45 -15
- data/lib/dokkit/filters/deplate.rb +11 -5
- data/lib/dokkit/hash.rb +41 -0
- data/lib/dokkit/models/Rakefile.tpl +9 -0
- data/lib/dokkit/models/share/builtin.rf +28 -0
- data/lib/dokkit/page.rb +161 -20
- data/lib/dokkit/render_task_factory.rb +91 -0
- data/lib/dokkit.rb +35 -42
- data/tests/data/output/simple_document/README +57 -0
- data/tests/data/output/simple_document/Rakefile +7 -0
- data/tests/data/output/simple_document/doc/config/simple_document.yaml +5 -0
- data/tests/data/output/simple_document/doc/pages/simple_document.dpl +12 -0
- data/{lib/dokkit/projects/website → tests/data/output/website_project}/Rakefile +2 -1
- data/tests/data/projects/simple-document/README +57 -0
- data/tests/data/projects/simple-document/Rakefile +22 -0
- data/tests/data/projects/simple-document/doc/config/author.yaml +4 -0
- data/tests/data/projects/simple-document/doc/config/model.yaml +18 -0
- data/tests/data/projects/simple-document/doc/config/simple_document.yaml +6 -0
- data/tests/data/projects/simple-document/doc/layouts/another_simple_document.html +8 -0
- data/tests/data/projects/simple-document/doc/layouts/another_simple_document.tex +10 -0
- data/tests/data/projects/simple-document/doc/layouts/layout_with_custom_name.html +8 -0
- data/tests/data/projects/simple-document/doc/layouts/semantic.cache +23 -0
- data/tests/data/projects/simple-document/doc/pages/COMMON.yaml +23 -0
- data/tests/data/projects/simple-document/doc/pages/another_simple_document.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/simple_document.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/simple_document_without_layout.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/subdir/COMMON.yaml +4 -0
- data/tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.yaml +3 -0
- data/tests/data/projects/simple-document/doc/pages/subdir/subdir/COMMON.yaml +2 -0
- data/tests/data/projects/simple-document/doc/pages/subdir/subdir/another_simple_document_in_subdir.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/yet_another_simple_document.dpl +12 -0
- data/tests/data/projects/simple-document/doc/pages/yet_another_simple_document.yaml +8 -0
- data/tests/spec_page.rb +25 -0
- data/tests/test.rb +2 -0
- data/tests/test_application.rb +40 -0
- data/tests/test_builtin_tasks.rb +37 -0
- data/tests/test_config.rb +108 -0
- data/tests/test_core.rb +12 -0
- data/tests/test_dokkit_commandline.rb +18 -0
- data/tests/test_exception.rb +7 -0
- data/tests/test_filters.rb +1 -1
- data/tests/test_layout.rb +64 -0
- data/tests/test_options.rb +33 -0
- data/tests/test_project_tasks.rb +48 -0
- data/tests/test_recursive_merge.rb +42 -0
- data/tests/test_task_factory.rb +38 -0
- metadata +138 -94
- data/Rakefile.old +0 -62
- data/lib/dokkit/builtin.rake +0 -55
- data/lib/dokkit/projects/invoice/Rakefile +0 -100
- data/lib/dokkit/projects/invoice/doc/config/company.yaml +0 -12
- data/lib/dokkit/projects/invoice/doc/config/customer.yaml +0 -4
- data/lib/dokkit/projects/invoice/doc/layouts/invoice.dpltex +0 -90
- data/lib/dokkit/projects/invoice/doc/pages/COMMON.rb +0 -12
- data/lib/dokkit/projects/invoice/doc/pages/invoice.rb +0 -5
- data/lib/dokkit/projects/invoice/doc/pages/invoice.yamltex +0 -16
- data/lib/dokkit/projects/invoice/doc/res/tex/deplate.sty +0 -46
- data/lib/dokkit/projects/invoice/doc/res/tex/images/logo.eps +0 -209
- data/lib/dokkit/projects/invoice/doc/res/tex/include/deplate.sty +0 -46
- data/lib/dokkit/projects/invoice/doc/res/tex/include/layout.inc +0 -24
- data/lib/dokkit/projects/invoice/doc/res/tex/include/macro.inc +0 -67
- data/lib/dokkit/projects/invoice/doc/res/tex/include/packages.inc +0 -51
- data/lib/dokkit/projects/invoice/lib/invoice.rb +0 -104
- data/lib/dokkit/projects/tech_report/README +0 -49
- data/lib/dokkit/projects/tech_report/Rakefile +0 -102
- data/lib/dokkit/projects/tech_report/doc/config/company.yaml +0 -13
- data/lib/dokkit/projects/tech_report/doc/config/tech_report.yaml +0 -3
- data/lib/dokkit/projects/tech_report/doc/layouts/report.dpltex +0 -40
- data/lib/dokkit/projects/tech_report/doc/pages/COMMON.rb +0 -12
- data/lib/dokkit/projects/tech_report/doc/pages/report.dpltex +0 -37
- data/lib/dokkit/projects/tech_report/doc/pages/report.inc +0 -2
- data/lib/dokkit/projects/tech_report/doc/pages/report.rb +0 -3
- data/lib/dokkit/projects/tech_report/doc/res/attachments/attachment_2 +0 -0
- data/lib/dokkit/projects/tech_report/doc/res/tex/images/logo.eps +0 -311
- data/lib/dokkit/projects/tech_report/doc/res/tex/include/deplate.sty +0 -46
- data/lib/dokkit/projects/tech_report/doc/res/tex/include/layout.inc +0 -24
- data/lib/dokkit/projects/tech_report/doc/res/tex/include/macro.inc +0 -67
- data/lib/dokkit/projects/tech_report/doc/res/tex/include/packages.inc +0 -48
- data/lib/dokkit/projects/tech_report/doc/res/tex/report.bib +0 -4
- data/lib/dokkit/projects/tech_report/lib/tech_report.rb +0 -17
- data/lib/dokkit/projects/website/README +0 -49
- /data/{lib/dokkit/projects/invoice → tests/data/output/website_project}/README +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/layouts/normal.thtml +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/pages/COMMON.rb +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/pages/deplate.dplhtml +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/pages/index.rb +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/pages/index.thtml +0 -0
- /data/{lib/dokkit/projects/website → tests/data/output/website_project}/doc/res/images/rote-tiny.png +0 -0
- /data/{lib/dokkit/projects/tech_report/doc/res/attachments/attachment_1 → tests/pages/test.dpltex} +0 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'dokkit'
|
4
|
+
require 'dokkit/app'
|
5
|
+
require 'dokkit/page'
|
6
|
+
require 'dokkit/hash'
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__),'../lib'))
|
9
|
+
|
10
|
+
class TestConfigMerge < Test::Unit::TestCase
|
11
|
+
def setup
|
12
|
+
@h1 = { :document => { :version => '0.1.0', :model => 'simple_document'} }
|
13
|
+
@h2 = { :document => { :title => 'A simple document', :author => 'John Doe'} }
|
14
|
+
@h3 = { :document => { :author => { :name => 'John', :surname => 'Doe'}, :layout => 'layout.html' } }
|
15
|
+
@h4 = { :info => { :date => '13/09/2007'} }
|
16
|
+
@h5 = { :document => 'overwritten' }
|
17
|
+
@h6 = { :document => [1, 2, 3] }
|
18
|
+
@h7 = { :document => [4, 5, 6] }
|
19
|
+
@result_0 = { }.recursive_merge @h1
|
20
|
+
@result_1 = @h1.recursive_merge @h2
|
21
|
+
@result_2 = @result_1.recursive_merge @h3
|
22
|
+
@result_3 = @result_2.recursive_merge @h4
|
23
|
+
@result_4 = @result_3.recursive_merge( { :info => { :language => 'en' } } )
|
24
|
+
@result_5 = @result_1.recursive_merge @h5
|
25
|
+
@result_6 = @h6.recursive_merge @h7
|
26
|
+
end
|
27
|
+
def test_merge
|
28
|
+
assert_equal('simple_document', @result_0[:document][:model])
|
29
|
+
assert_equal('simple_document', @result_1[:document][:model])
|
30
|
+
assert_equal('0.1.0', @result_1[:document][:version])
|
31
|
+
assert_equal('A simple document', @result_1[:document][:title])
|
32
|
+
assert_equal('John Doe', @result_1[:document][:author])
|
33
|
+
assert_equal('John', @result_2[:document][:author][:name])
|
34
|
+
assert_equal('Doe', @result_2[:document][:author][:surname])
|
35
|
+
assert_equal('layout.html', @result_2[:document][:layout])
|
36
|
+
assert_equal('13/09/2007', @result_3[:info][:date])
|
37
|
+
assert_equal('Doe', @result_3[:document][:author][:surname])
|
38
|
+
assert_equal('en', @result_4[:info][:language])
|
39
|
+
assert_equal('overwritten', @result_5[:document])
|
40
|
+
assert_equal([1, 2, 3, 4, 5, 6], @result_6[:document])
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#
|
2
|
+
# File 'test_task_factory.rb' created on 18 Nov 2007 at 15:41:47.
|
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_task_factory.rb
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'rubygems'
|
13
|
+
require 'test/unit'
|
14
|
+
require 'dokkit'
|
15
|
+
require 'dokkit/app'
|
16
|
+
require 'dokkit/render_task_factory'
|
17
|
+
|
18
|
+
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__),'../lib'))
|
19
|
+
|
20
|
+
class TestTaskFactory < Test::Unit::TestCase
|
21
|
+
def setup
|
22
|
+
@render_task_factory = Dokkit::RenderTaskFactory.instance
|
23
|
+
end
|
24
|
+
def teardown
|
25
|
+
end
|
26
|
+
def test_task_create
|
27
|
+
assert_not_nil(@render_task_factory.create_render_html)
|
28
|
+
end
|
29
|
+
def test_task_output_dir
|
30
|
+
assert_not_nil(@render_task_factory.create_render_html.output_dir)
|
31
|
+
end
|
32
|
+
def test_task_customization
|
33
|
+
render_html = @render_task_factory.create_render_html do |task|
|
34
|
+
task.pages.exclude('**/*.inc')
|
35
|
+
end
|
36
|
+
assert(render_html.pages.excludes.include?('**/*.inc'))
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: dokkit
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date:
|
8
|
-
summary: Ruby Documentation
|
6
|
+
version: 0.2.0
|
7
|
+
date: 2007-12-25 00:00:00 +01:00
|
8
|
+
summary: Ruby Documentation toolKit
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: andrea.fazzi@alca.le.it
|
12
|
-
homepage: http://dokkit.rubyforge.org
|
12
|
+
homepage: http://dokkit.rubyforge.org/
|
13
13
|
rubyforge_project: dokkit
|
14
|
-
description: dokkit is an open source
|
14
|
+
description: dokkit is an open source document generator based on rote.
|
15
15
|
autorequire: dokkit
|
16
|
-
default_executable:
|
16
|
+
default_executable: dokkit
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
@@ -25,119 +25,163 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- Andrea Fazzi
|
30
31
|
files:
|
31
32
|
- lib/dokkit
|
32
|
-
- lib/dokkit.rb
|
33
|
-
- lib/dokkit/
|
33
|
+
- lib/dokkit/hash.rb
|
34
|
+
- lib/dokkit/models
|
35
|
+
- lib/dokkit/models/Rakefile.tpl
|
36
|
+
- lib/dokkit/models/share
|
37
|
+
- lib/dokkit/models/share/builtin.rf
|
38
|
+
- lib/dokkit/#render_task_factory.rb#
|
34
39
|
- lib/dokkit/page.rb
|
35
|
-
- lib/dokkit/dokkittasks.rb
|
36
40
|
- lib/dokkit/filters
|
41
|
+
- lib/dokkit/filters/deplate.rb
|
37
42
|
- lib/dokkit/filters.rb
|
38
|
-
- lib/dokkit/projects
|
39
|
-
- lib/dokkit/builtin.rake
|
40
43
|
- lib/dokkit/deplate
|
41
|
-
- lib/dokkit/filters/deplate.rb
|
42
|
-
- lib/dokkit/projects/invoice
|
43
|
-
- lib/dokkit/projects/tech_report
|
44
|
-
- lib/dokkit/projects/website
|
45
|
-
- lib/dokkit/projects/invoice/doc
|
46
|
-
- lib/dokkit/projects/invoice/Rakefile
|
47
|
-
- lib/dokkit/projects/invoice/README
|
48
|
-
- lib/dokkit/projects/invoice/lib
|
49
|
-
- lib/dokkit/projects/invoice/doc/layouts
|
50
|
-
- lib/dokkit/projects/invoice/doc/pages
|
51
|
-
- lib/dokkit/projects/invoice/doc/res
|
52
|
-
- lib/dokkit/projects/invoice/doc/config
|
53
|
-
- lib/dokkit/projects/invoice/doc/layouts/invoice.dpltex
|
54
|
-
- lib/dokkit/projects/invoice/doc/pages/COMMON.rb
|
55
|
-
- lib/dokkit/projects/invoice/doc/pages/invoice.rb
|
56
|
-
- lib/dokkit/projects/invoice/doc/pages/invoice.yamltex
|
57
|
-
- lib/dokkit/projects/invoice/doc/res/images
|
58
|
-
- lib/dokkit/projects/invoice/doc/res/tex
|
59
|
-
- lib/dokkit/projects/invoice/doc/res/tex/images
|
60
|
-
- lib/dokkit/projects/invoice/doc/res/tex/include
|
61
|
-
- lib/dokkit/projects/invoice/doc/res/tex/deplate.sty
|
62
|
-
- lib/dokkit/projects/invoice/doc/res/tex/images/logo.eps
|
63
|
-
- lib/dokkit/projects/invoice/doc/res/tex/include/deplate.sty
|
64
|
-
- lib/dokkit/projects/invoice/doc/res/tex/include/layout.inc
|
65
|
-
- lib/dokkit/projects/invoice/doc/res/tex/include/macro.inc
|
66
|
-
- lib/dokkit/projects/invoice/doc/res/tex/include/packages.inc
|
67
|
-
- lib/dokkit/projects/invoice/doc/config/company.yaml
|
68
|
-
- lib/dokkit/projects/invoice/doc/config/customer.yaml
|
69
|
-
- lib/dokkit/projects/invoice/lib/invoice.rb
|
70
|
-
- lib/dokkit/projects/tech_report/doc
|
71
|
-
- lib/dokkit/projects/tech_report/Rakefile
|
72
|
-
- lib/dokkit/projects/tech_report/README
|
73
|
-
- lib/dokkit/projects/tech_report/lib
|
74
|
-
- lib/dokkit/projects/tech_report/doc/layouts
|
75
|
-
- lib/dokkit/projects/tech_report/doc/pages
|
76
|
-
- lib/dokkit/projects/tech_report/doc/res
|
77
|
-
- lib/dokkit/projects/tech_report/doc/config
|
78
|
-
- lib/dokkit/projects/tech_report/doc/layouts/report.dpltex
|
79
|
-
- lib/dokkit/projects/tech_report/doc/pages/COMMON.rb
|
80
|
-
- lib/dokkit/projects/tech_report/doc/pages/report.dpltex
|
81
|
-
- lib/dokkit/projects/tech_report/doc/pages/report.rb
|
82
|
-
- lib/dokkit/projects/tech_report/doc/pages/report.inc
|
83
|
-
- lib/dokkit/projects/tech_report/doc/res/images
|
84
|
-
- lib/dokkit/projects/tech_report/doc/res/tex
|
85
|
-
- lib/dokkit/projects/tech_report/doc/res/attachments
|
86
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/images
|
87
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/include
|
88
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/report.bib
|
89
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/images/logo.eps
|
90
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/include/deplate.sty
|
91
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/include/layout.inc
|
92
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/include/macro.inc
|
93
|
-
- lib/dokkit/projects/tech_report/doc/res/tex/include/packages.inc
|
94
|
-
- lib/dokkit/projects/tech_report/doc/res/attachments/attachment_1
|
95
|
-
- lib/dokkit/projects/tech_report/doc/res/attachments/attachment_2
|
96
|
-
- lib/dokkit/projects/tech_report/doc/config/company.yaml
|
97
|
-
- lib/dokkit/projects/tech_report/doc/config/tech_report.yaml
|
98
|
-
- lib/dokkit/projects/tech_report/lib/tech_report.rb
|
99
|
-
- lib/dokkit/projects/website/doc
|
100
|
-
- lib/dokkit/projects/website/Rakefile
|
101
|
-
- lib/dokkit/projects/website/README
|
102
|
-
- lib/dokkit/projects/website/doc/pages
|
103
|
-
- lib/dokkit/projects/website/doc/res
|
104
|
-
- lib/dokkit/projects/website/doc/layouts
|
105
|
-
- lib/dokkit/projects/website/doc/pages/COMMON.rb
|
106
|
-
- lib/dokkit/projects/website/doc/pages/index.rb
|
107
|
-
- lib/dokkit/projects/website/doc/pages/index.thtml
|
108
|
-
- lib/dokkit/projects/website/doc/pages/deplate.dplhtml
|
109
|
-
- lib/dokkit/projects/website/doc/res/images
|
110
|
-
- lib/dokkit/projects/website/doc/res/images/rote-tiny.png
|
111
|
-
- lib/dokkit/projects/website/doc/layouts/normal.thtml
|
112
44
|
- lib/dokkit/deplate/fmt
|
113
|
-
- lib/dokkit/deplate/fmt/latex-notemplate.rb
|
114
45
|
- lib/dokkit/deplate/fmt/html-notemplate.rb
|
46
|
+
- lib/dokkit/deplate/fmt/latex-notemplate.rb
|
47
|
+
- lib/dokkit/render_task_factory.rb
|
48
|
+
- lib/dokkit/dokkittasks.rb
|
49
|
+
- lib/dokkit/app.rb
|
50
|
+
- lib/dokkit.rb
|
115
51
|
- bin/dokkit
|
116
|
-
- CONTRIBUTORS
|
117
|
-
- DONE
|
118
|
-
- LICENSE
|
119
52
|
- README
|
120
|
-
-
|
53
|
+
- DONE
|
54
|
+
- CONTRIBUTORS
|
121
55
|
- TODO
|
122
|
-
- Rakefile.old
|
123
56
|
- CHANGES
|
57
|
+
- LICENSE
|
58
|
+
- Rakefile
|
59
|
+
- tests/test_builtin_tasks.rb
|
60
|
+
- tests/test_config.rb
|
61
|
+
- tests/test.rb
|
62
|
+
- tests/data
|
63
|
+
- tests/data/projects
|
64
|
+
- tests/data/projects/simple-document
|
65
|
+
- tests/data/projects/simple-document/README
|
66
|
+
- tests/data/projects/simple-document/doc
|
67
|
+
- tests/data/projects/simple-document/doc/layouts
|
68
|
+
- tests/data/projects/simple-document/doc/layouts/semantic.cache
|
69
|
+
- tests/data/projects/simple-document/doc/layouts/another_simple_document.html
|
70
|
+
- tests/data/projects/simple-document/doc/layouts/layout_with_custom_name.html
|
71
|
+
- tests/data/projects/simple-document/doc/layouts/another_simple_document.tex
|
72
|
+
- tests/data/projects/simple-document/doc/config
|
73
|
+
- tests/data/projects/simple-document/doc/config/model.yaml
|
74
|
+
- tests/data/projects/simple-document/doc/config/author.yaml
|
75
|
+
- tests/data/projects/simple-document/doc/config/simple_document.yaml
|
76
|
+
- tests/data/projects/simple-document/doc/pages
|
77
|
+
- tests/data/projects/simple-document/doc/pages/simple_document_without_layout.dpl
|
78
|
+
- tests/data/projects/simple-document/doc/pages/another_simple_document.dpl
|
79
|
+
- tests/data/projects/simple-document/doc/pages/subdir
|
80
|
+
- tests/data/projects/simple-document/doc/pages/subdir/subdir
|
81
|
+
- tests/data/projects/simple-document/doc/pages/subdir/subdir/COMMON.yaml
|
82
|
+
- tests/data/projects/simple-document/doc/pages/subdir/subdir/another_simple_document_in_subdir.dpl
|
83
|
+
- tests/data/projects/simple-document/doc/pages/subdir/COMMON.yaml
|
84
|
+
- tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.dpl
|
85
|
+
- tests/data/projects/simple-document/doc/pages/subdir/simple_document_in_subdir.yaml
|
86
|
+
- tests/data/projects/simple-document/doc/pages/COMMON.yaml
|
87
|
+
- tests/data/projects/simple-document/doc/pages/yet_another_simple_document.dpl
|
88
|
+
- tests/data/projects/simple-document/doc/pages/yet_another_simple_document.yaml
|
89
|
+
- tests/data/projects/simple-document/doc/pages/simple_document.dpl
|
90
|
+
- tests/data/projects/simple-document/Rakefile
|
91
|
+
- tests/data/output
|
92
|
+
- tests/data/output/simple_document
|
93
|
+
- tests/data/output/simple_document/README
|
94
|
+
- tests/data/output/simple_document/doc
|
95
|
+
- tests/data/output/simple_document/doc/config
|
96
|
+
- tests/data/output/simple_document/doc/config/simple_document.yaml
|
97
|
+
- tests/data/output/simple_document/doc/pages
|
98
|
+
- tests/data/output/simple_document/doc/pages/simple_document.dpl
|
99
|
+
- tests/data/output/simple_document/Rakefile
|
100
|
+
- tests/data/output/website_project
|
101
|
+
- tests/data/output/website_project/README
|
102
|
+
- tests/data/output/website_project/doc
|
103
|
+
- tests/data/output/website_project/doc/layouts
|
104
|
+
- tests/data/output/website_project/doc/layouts/normal.thtml
|
105
|
+
- tests/data/output/website_project/doc/config
|
106
|
+
- tests/data/output/website_project/doc/pages
|
107
|
+
- tests/data/output/website_project/doc/pages/index.rb
|
108
|
+
- tests/data/output/website_project/doc/pages/deplate.dplhtml
|
109
|
+
- tests/data/output/website_project/doc/pages/index.thtml
|
110
|
+
- tests/data/output/website_project/doc/pages/COMMON.rb
|
111
|
+
- tests/data/output/website_project/doc/res
|
112
|
+
- tests/data/output/website_project/doc/res/images
|
113
|
+
- tests/data/output/website_project/doc/res/images/rote-tiny.png
|
114
|
+
- tests/data/output/website_project/Rakefile
|
115
|
+
- tests/test_project_tasks.rb
|
124
116
|
- tests/gem_tests.rb
|
117
|
+
- tests/test_exception.rb
|
118
|
+
- tests/test_application.rb
|
119
|
+
- tests/test_task_factory.rb
|
120
|
+
- tests/test_core.rb
|
121
|
+
- tests/spec_page.rb
|
122
|
+
- tests/test_options.rb
|
123
|
+
- tests/test_layout.rb
|
124
|
+
- tests/test_dokkit_commandline.rb
|
125
|
+
- tests/pages
|
126
|
+
- tests/pages/test.dpltex
|
127
|
+
- tests/test_recursive_merge.rb
|
125
128
|
- tests/test_filters.rb
|
126
129
|
test_files: []
|
127
130
|
|
128
131
|
rdoc_options:
|
129
132
|
- --title
|
130
|
-
-
|
133
|
+
- dokkit
|
131
134
|
- --main
|
132
135
|
- README
|
133
136
|
- --line-numbers
|
134
137
|
extra_rdoc_files:
|
135
138
|
- README
|
136
|
-
|
137
|
-
|
139
|
+
- DONE
|
140
|
+
- CONTRIBUTORS
|
141
|
+
- TODO
|
142
|
+
- CHANGES
|
143
|
+
- LICENSE
|
144
|
+
- Rakefile
|
145
|
+
executables:
|
146
|
+
- dokkit
|
138
147
|
extensions: []
|
139
148
|
|
140
149
|
requirements: []
|
141
150
|
|
142
|
-
dependencies:
|
143
|
-
|
151
|
+
dependencies:
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: deplate
|
154
|
+
version_requirement:
|
155
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: "0.8"
|
160
|
+
version:
|
161
|
+
- !ruby/object:Gem::Dependency
|
162
|
+
name: rote
|
163
|
+
version_requirement:
|
164
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 0.3.4
|
169
|
+
version:
|
170
|
+
- !ruby/object:Gem::Dependency
|
171
|
+
name: rake
|
172
|
+
version_requirement:
|
173
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 0.0.0
|
178
|
+
version:
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: syntax
|
181
|
+
version_requirement:
|
182
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 0.0.0
|
187
|
+
version:
|
data/Rakefile.old
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
# Standard Rakefile for custom Dokkit build
|
2
|
-
#
|
3
|
-
#
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'rubygems'
|
7
|
-
rescue LoadError
|
8
|
-
nil # optional
|
9
|
-
end
|
10
|
-
|
11
|
-
require 'rake'
|
12
|
-
require 'rake/clean'
|
13
|
-
require 'rake/testtask'
|
14
|
-
require 'rake/rdoctask'
|
15
|
-
require 'rake/gempackagetask'
|
16
|
-
|
17
|
-
CLOBBER.include('html')
|
18
|
-
CLOBBER.include('tex')
|
19
|
-
|
20
|
-
Rake::RDocTask.new do |rd|
|
21
|
-
rd.main = "README"
|
22
|
-
rd.rdoc_files.include("README", "lib/**/*.rb", "tests/*.rb")
|
23
|
-
rd.rdoc_dir = "apidoc"
|
24
|
-
rd.options.push('-d').push('-F')
|
25
|
-
end
|
26
|
-
|
27
|
-
desc "Run basic tests"
|
28
|
-
Rake::TestTask.new("test_units") { |t|
|
29
|
-
t.pattern = 'tests/ts_*.rb'
|
30
|
-
t.verbose = true
|
31
|
-
#t.warning = true
|
32
|
-
}
|
33
|
-
|
34
|
-
spec = Gem::Specification.new do |s|
|
35
|
-
s.platform = Gem::Platform::RUBY
|
36
|
-
s.summary = "Ruby Documentation ToolKit."
|
37
|
-
s.name = 'dokkit'
|
38
|
-
s.version = '0.1.0'
|
39
|
-
|
40
|
-
s.add_dependency('deplate', '>= 0.8')
|
41
|
-
s.add_dependency('rote', '>= 0.3.2.2')
|
42
|
-
s.add_dependency('rake')
|
43
|
-
s.add_dependency('syntax')
|
44
|
-
|
45
|
-
s.has_rdoc = true
|
46
|
-
s.test_file = 'tests/gem_tests.rb'
|
47
|
-
|
48
|
-
s.require_path = 'lib'
|
49
|
-
s.autorequire = 'dokkit'
|
50
|
-
s.bindir = 'bin'
|
51
|
-
s.executables << 'dokkit'
|
52
|
-
s.extra_rdoc_files << 'README'
|
53
|
-
s.files = FileList['lib/**/*', 'bin/*', '[A-Z]*', 'tests/*', 'tests/**/**'].exclude(/alca/).to_a
|
54
|
-
s.description = <<-EOF
|
55
|
-
Dokkit is a documentation toolkit based on Rote.
|
56
|
-
EOF
|
57
|
-
end
|
58
|
-
|
59
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
60
|
-
pkg.need_zip = true
|
61
|
-
pkg.need_tar = true
|
62
|
-
end
|
data/lib/dokkit/builtin.rake
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
# Built-in Dokkit rakefile
|
2
|
-
#
|
3
|
-
# This is effectively a copy of the template rakefile,
|
4
|
-
# but with extra tasks for the command-line wrapper.
|
5
|
-
#
|
6
|
-
# (c)2006 Andrea Fazzi (and contributors)
|
7
|
-
#
|
8
|
-
begin
|
9
|
-
require 'rubygems'
|
10
|
-
rescue LoadError
|
11
|
-
nil # optional
|
12
|
-
end
|
13
|
-
require 'rake'
|
14
|
-
require 'rake/clean'
|
15
|
-
require 'dokkit'
|
16
|
-
|
17
|
-
# Import tasks for current project
|
18
|
-
|
19
|
-
#################### CREATE NEW PROJECT FROM TEMPLATE ###############
|
20
|
-
#
|
21
|
-
# This works in a slightly odd way. The 'create' task simply sets up
|
22
|
-
# a rule that catches anything. This rule will then be triggered by
|
23
|
-
# the task that follows on the command-line, and taken as the
|
24
|
-
# target directory name.
|
25
|
-
#
|
26
|
-
# So instead of 'dokkit create NAME=foo' we have 'dokkit create foo'
|
27
|
-
#
|
28
|
-
# Note that this does preclude having other tasks on the same
|
29
|
-
# invocation (after the create at least) but does also allow
|
30
|
-
# multiple projects to be created at once.
|
31
|
-
#
|
32
|
-
# Also need a way to display error message if the rule isn't
|
33
|
-
# invoked at least once...
|
34
|
-
# /(((\w*\/)*)(\w*))\/{2}(((\w*\/)*)(\w*))/.match(t.name)
|
35
|
-
|
36
|
-
desc "Bootstrap a new documentation project"
|
37
|
-
task :create do
|
38
|
-
rule '' do |t|
|
39
|
-
fail "#{t.name} already exists" if File.exists?(t.name)
|
40
|
-
|
41
|
-
src = ENV['PROJECT']
|
42
|
-
src_dir = Dokkit::Application.get_project_dirs.detect { |it| File.exists?(File.join(File.expand_path(it),src)) }
|
43
|
-
|
44
|
-
fail "Cannot locate project template #{src}!\n" unless src_dir
|
45
|
-
|
46
|
-
cp_r File.join(File.expand_path(src_dir), src), t.name
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
#src = ENV['PROJECT']
|
51
|
-
#src_dir = Dokkit::Application.get_project_dirs.detect { |it| File.exists?(File.join(File.expand_path(it),src)) }
|
52
|
-
|
53
|
-
#import "#{File.join(File.join(src_dir,src),'Rakefile')}" if File.exists?(File.join(File.join(src_dir,src),'Rakefile'))
|
54
|
-
#import File.join(File.dirname(__FILE__),('/projects/tech_report/Rakefile'))
|
55
|
-
|
@@ -1,100 +0,0 @@
|
|
1
|
-
# Standard Rakefile for dokkit documentation build
|
2
|
-
#
|
3
|
-
#
|
4
|
-
begin
|
5
|
-
require 'rubygems'
|
6
|
-
rescue LoadError
|
7
|
-
nil # optional
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'rake'
|
11
|
-
require 'rake/clean'
|
12
|
-
require 'rote/format'
|
13
|
-
require 'dokkit'
|
14
|
-
require 'dokkit/filters'
|
15
|
-
require 'lib/invoice'
|
16
|
-
|
17
|
-
include Rote
|
18
|
-
include Dokkit
|
19
|
-
|
20
|
-
CMD_LATEX = "latex -interaction=batchmode"
|
21
|
-
CMD_BIBTEX = "bibtex"
|
22
|
-
|
23
|
-
# Check if bibliography exists.
|
24
|
-
|
25
|
-
def bib_exists?
|
26
|
-
if Dir["*.bib"].empty?
|
27
|
-
false
|
28
|
-
else
|
29
|
-
true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# Create a set of tasks with the prefix 'doc' to build the
|
34
|
-
# documentation set. The directory layout is as for the
|
35
|
-
# command-line wrapper (but can be changed of course).
|
36
|
-
#
|
37
|
-
# This creates the following tasks:
|
38
|
-
#
|
39
|
-
# * doc - transform/copy all modified pages / resources
|
40
|
-
# * doc_pages - transform all modified pages
|
41
|
-
# * doc_res - copy all modified resources
|
42
|
-
# * doc_monitor - Start monitor mode, transform changed files automatically
|
43
|
-
#
|
44
|
-
# * [html/**/*] - Transform single page / resource unconditionally
|
45
|
-
#
|
46
|
-
# * clobber_doc - Remove output (hooks into main 'clobber' task)
|
47
|
-
#
|
48
|
-
# In addition to these tasks, you may also wish to define a 'doc_refresh' task
|
49
|
-
# to be run whenever modified resources are processed in monitor mode.
|
50
|
-
|
51
|
-
doc = Rote::DocTask.new(:doc) do |invoice|
|
52
|
-
invoice.output_dir = 'tex'
|
53
|
-
invoice.layout_dir = 'doc/layouts'
|
54
|
-
invoice.config_dir = 'doc/config'
|
55
|
-
|
56
|
-
invoice.pages.dir = 'doc/pages'
|
57
|
-
invoice.pages.include('**/*.yaml*')
|
58
|
-
invoice.pages.exclude('**/*.yaml')
|
59
|
-
|
60
|
-
invoice.res.dir = 'doc/res/tex'
|
61
|
-
invoice.res.include('**/*')
|
62
|
-
|
63
|
-
invoice.ext_mapping(/yamltex/, 'tex') do |page|
|
64
|
-
page.page_filter Dokkit::Filters::Deplate.new('latex-notemplate')
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
doc_dvi = Rote::DocTask.new(:doc_dvi) do |site|
|
70
|
-
|
71
|
-
site.output_dir = 'tex'
|
72
|
-
site.pages.dir = 'doc/pages'
|
73
|
-
end
|
74
|
-
|
75
|
-
task :doc_dvi => [:doc] do
|
76
|
-
pwd = Dir.getwd
|
77
|
-
Dir.chdir(doc_dvi.output_dir)
|
78
|
-
Dir["*.tex"].each { |file| 2.times { sh "#{CMD_LATEX} #{file}" } }
|
79
|
-
|
80
|
-
if bib_exists? then
|
81
|
-
Dir["*.aux"].each do |file|
|
82
|
-
if File.exists?(File.basename(file).sub(/.aux$/,".bib"))
|
83
|
-
sh "#{CMD_BIBTEX} #{file}"
|
84
|
-
2.times { sh "#{CMD_LATEX} #{File.basename(file).sub(/.aux$/,".tex")}" }
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
Dir.chdir(pwd)
|
90
|
-
end
|
91
|
-
|
92
|
-
task :default => [:doc]
|
93
|
-
|
94
|
-
# import user-level tasks
|
95
|
-
#import "#{ENV['HOME']}/.rotetasks.rf" if File.exists?("#{ENV['HOME']}/.rotetasks.rf")
|
96
|
-
#import 'local.rf' if File.exists?('local.rf')
|
97
|
-
|
98
|
-
# TODO Define your custom tasks here
|
99
|
-
|
100
|
-
|
@@ -1,90 +0,0 @@
|
|
1
|
-
\documentclass[a4paper,10pt]{article}
|
2
|
-
|
3
|
-
\input{include/packages.inc}
|
4
|
-
|
5
|
-
\usepackage{include/deplate}
|
6
|
-
|
7
|
-
\newcommand{\layout}[1][]{
|
8
|
-
\geometry{
|
9
|
-
left=2cm,
|
10
|
-
right=2cm,
|
11
|
-
top=2cm,
|
12
|
-
bottom=1.7cm,
|
13
|
-
headheight=1cm,
|
14
|
-
headsep=1cm,
|
15
|
-
footskip=1cm,
|
16
|
-
includeheadfoot}
|
17
|
-
\pagestyle{fancy}
|
18
|
-
\fancyhead{}
|
19
|
-
\fancyfoot{}
|
20
|
-
\lhead{\includegraphics[height=1cm]{images/logo.eps}}
|
21
|
-
\rhead{\fontfamily{cmss}\large\textbf{#1}\vspace*{\stretch{1}}\normalsize}
|
22
|
-
\lfoot{
|
23
|
-
\fontfamily{cmss}\scriptsize\textbf{<%= @config['company']['name'] %>} $\star$ \textbf{Indirizzo} <%= @config['company']['address'] %> $\star$ \textbf{P.IVA} <%= @config['company']['vat_number'] %>\\ \textbf{E-mail} <%= @config['company']['email'] %> $\star$ \textbf{Web} <%= @config['company']['website'] %> \normalsize
|
24
|
-
}
|
25
|
-
\rfoot{
|
26
|
-
\fontfamily{cmss}\textit{pag. \thepage\ / \pageref{LastPage}}
|
27
|
-
}
|
28
|
-
\renewcommand{\footrulewidth}{0.4pt}
|
29
|
-
}
|
30
|
-
|
31
|
-
\newcommand{\destinatario}[1]{\noindent\begin{flushright}\begin{minipage}{7cm}\textbf{Destinatario}\\\rule{\textwidth}{0.1mm}\\{#1}\end{minipage}\end{flushright}}
|
32
|
-
|
33
|
-
\layout[Fattura n. <%= @id %> del <%= @date %>]
|
34
|
-
|
35
|
-
\sffamily
|
36
|
-
\parindent=0pt
|
37
|
-
|
38
|
-
\begin{document}
|
39
|
-
|
40
|
-
|
41
|
-
\destinatario{
|
42
|
-
\textbf{<%= @config['customer']['name'] %>} \\
|
43
|
-
<%= @config['customer']['address'] %> \\
|
44
|
-
P.Iva: \textbf{<%= @config['customer']['vat_number'] %>}
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
\vspace*{2cm}
|
49
|
-
|
50
|
-
\noindent
|
51
|
-
\begin{longtable}{@{\extracolsep{\fill}}m{5cm}crr}
|
52
|
-
\textbf{Descrizione} & \textbf{Qu.} & \textbf{Importo unit.(\euro)} & \textbf{Importo tot.(\euro)} \\
|
53
|
-
\hline
|
54
|
-
\endhead
|
55
|
-
% Inserire qui i dati del preventivo
|
56
|
-
<%= @content_for_layout %>
|
57
|
-
& & \small Imponibile & \small \euro<%= @basic_price %> \\
|
58
|
-
& & \small IVA <%= @vat %>\% & \small \euro<%= @vat_price %> \\
|
59
|
-
& & \small\textbf{Totale Fattura} & \small\textbf{\euro<%= @total_price %>} \\
|
60
|
-
\end{longtable}
|
61
|
-
\normalsize
|
62
|
-
|
63
|
-
\footnotesize
|
64
|
-
\noindent
|
65
|
-
\textbf{Note}\\
|
66
|
-
Si prega di effettuare il pagamento a mezzo bonifico bancario intestato ad \textit{<%= @config['company']['name'] %>} usando le coordinate bancarie indicate di seguito:\\
|
67
|
-
|
68
|
-
%\begin{center}
|
69
|
-
\noindent
|
70
|
-
%\begin{tabular*}{0.92\textwidth}{ccccc}
|
71
|
-
%\textbf{Banca} & \textbf{ABI} & \textbf{CAB} & \textbf{CIN} & \textbf{C/C} \\
|
72
|
-
%\hline
|
73
|
-
\textbf{Banca:} <%= @config['company']['bank_name'] %> \\
|
74
|
-
\textbf{ABI:} <%= @config['company']['bank_abi'] %> \\
|
75
|
-
\textbf{CAB:} <%= @config['company']['bank_cab'] %> \\
|
76
|
-
\textbf{CIN:} <%= @config['company']['bank_cin'] %> \\
|
77
|
-
\textbf{C/C:} <%= @config['company']['bank_current_account'] %> \\
|
78
|
-
%\hline
|
79
|
-
%\end{tabular*}
|
80
|
-
%\end{center}
|
81
|
-
|
82
|
-
\noindent
|
83
|
-
(Indicare nella causale la ragione sociale e il numero di fattura. Se possibile, inviare via-fax o via-email la ricevuta del bonifico).
|
84
|
-
\normalsize
|
85
|
-
|
86
|
-
\vspace*{2cm}
|
87
|
-
|
88
|
-
Cogliamo l'occasione per porgere cordiali saluti.
|
89
|
-
|
90
|
-
\end{document}
|