dokkit 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -59
- data/lib/dokkit.rb +1 -1
- data/lib/dokkit/environment/basic.rb +23 -8
- data/lib/dokkit/filters.rb +1 -0
- data/lib/dokkit/filters/erb.rb +3 -3
- data/lib/dokkit/filters/haml.rb +31 -0
- data/lib/dokkit/models/simple/doc/layouts/simple.html +1 -1
- data/lib/dokkit/resource/document.rb +59 -63
- metadata +3 -61
- data/spec/dokkit/application_spec.rb +0 -141
- data/spec/dokkit/cache/cache_spec.rb +0 -87
- data/spec/dokkit/dokkit_spec.rb +0 -20
- data/spec/dokkit/environment/basic_spec.rb +0 -138
- data/spec/dokkit/environment/helpers/extmap_spec.rb +0 -52
- data/spec/dokkit/environment/helpers/fileselection_spec.rb +0 -80
- data/spec/dokkit/environment/helpers/test_data/doc/pages/document_1.ext_1 +0 -0
- data/spec/dokkit/environment/helpers/test_data/doc/pages/document_2 +0 -0
- data/spec/dokkit/environment/helpers/test_data/doc/pages/document_3.ext_3 +0 -0
- data/spec/dokkit/environment/test_data/doc/data/data +0 -0
- data/spec/dokkit/environment/test_data/doc/pages/document_1 +0 -0
- data/spec/dokkit/environment/test_data/doc/pages/document_1.yaml +0 -3
- data/spec/dokkit/environment/test_data/doc/pages/document_2 +0 -0
- data/spec/dokkit/environment/test_data/doc/pages/subdir/document_1 +0 -0
- data/spec/dokkit/factory/factory_spec.rb +0 -69
- data/spec/dokkit/filters/deplate_spec.rb +0 -47
- data/spec/dokkit/filters/erb_spec.rb +0 -26
- data/spec/dokkit/filters/maruku_spec.rb +0 -28
- data/spec/dokkit/filters/nil_spec.rb +0 -29
- data/spec/dokkit/filters/tidy_spec.rb +0 -48
- data/spec/dokkit/hash_spec.rb +0 -89
- data/spec/dokkit/logging/logger_spec.rb +0 -138
- data/spec/dokkit/logging/observers/console_spec.rb +0 -68
- data/spec/dokkit/resource/data_spec.rb +0 -32
- data/spec/dokkit/resource/document_spec.rb +0 -523
- data/spec/dokkit/resource/extensions/html_spec.rb +0 -35
- data/spec/dokkit/resource/extensions/url_spec.rb +0 -29
- data/spec/dokkit/resource/filenamehelper_spec.rb +0 -33
- data/spec/dokkit/resource/test_data/doc/configs/config_1.yaml +0 -3
- data/spec/dokkit/resource/test_data/doc/configs/config_2.yaml +0 -3
- data/spec/dokkit/resource/test_data/doc/configs/required.yaml +0 -3
- data/spec/dokkit/resource/test_data/doc/configs/subdir/document.yaml +0 -3
- data/spec/dokkit/resource/test_data/doc/layouts/container.html +0 -6
- data/spec/dokkit/resource/test_data/doc/layouts/layout.html +0 -6
- data/spec/dokkit/resource/test_data/doc/layouts/layout.latex +0 -8
- data/spec/dokkit/resource/test_data/doc/layouts/nested/nested.html +0 -4
- data/spec/dokkit/resource/test_data/doc/layouts/subdir/document.html +0 -6
- data/spec/dokkit/resource/test_data/doc/layouts/subdir/document.latex +0 -8
- data/spec/dokkit/resource/test_data/doc/pages/COMMON.yaml +0 -4
- data/spec/dokkit/resource/test_data/doc/pages/document_with_many_config.ext +0 -7
- data/spec/dokkit/resource/test_data/doc/pages/document_with_many_errors.ext +0 -12
- data/spec/dokkit/resource/test_data/doc/pages/document_with_many_targets.ext +0 -19
- data/spec/dokkit/resource/test_data/doc/pages/document_with_nested_layout.ext +0 -13
- data/spec/dokkit/resource/test_data/doc/pages/document_with_nil_target.ext +0 -5
- data/spec/dokkit/resource/test_data/doc/pages/document_with_not_defined_target.ext +0 -6
- data/spec/dokkit/resource/test_data/doc/pages/document_with_one_target.ext +0 -8
- data/spec/dokkit/resource/test_data/doc/pages/document_with_postfilter.ext +0 -10
- data/spec/dokkit/resource/test_data/doc/pages/subdir/COMMON.yaml +0 -3
- data/spec/dokkit/resource/test_data/doc/pages/subdir/document.ext +0 -8
- data/spec/dokkit/resource/test_data/doc/pages/subdir/document.yaml +0 -5
- data/spec/dokkit/tasklib/clean_spec.rb +0 -75
- data/spec/dokkit/tasklib/render_spec.rb +0 -125
- data/spec/dokkit/tasklib/test_data/doc/data/data_1 +0 -0
- data/spec/dokkit/tasklib/test_data/doc/pages/document_1 +0 -0
- data/spec/dokkit/tasklib/test_data/doc/pages/document_2 +0 -0
- data/spec/dokkit/test_data/dokkit/models/model1/doc/pages/model1 +0 -0
- data/spec/dokkit/test_data/dokkit/models/model2/doc/pages/model2 +0 -0
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -139
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec.opts
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# File 'spec_helper.rb' created on 12 gen 2008 at 20:25:09.
|
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
|
-
|
8
|
-
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__),'../lib')))
|
9
|
-
|
10
|
-
require 'dokkit/hash'
|
11
|
-
|
12
|
-
module SpecHelper
|
13
|
-
module Path
|
14
|
-
TEST_DATA = 'test_data'
|
15
|
-
DATA_DEST_DIR = 'data'
|
16
|
-
CACHE_PATH = '.cache'
|
17
|
-
DOCUMENT_PATH = 'doc/pages'
|
18
|
-
DATA_PATH = 'doc/data'
|
19
|
-
CONFIG_PATH = 'doc/configs'
|
20
|
-
LAYOUT_PATH = 'doc/layouts'
|
21
|
-
TEMPLATE_PATH = 'templates'
|
22
|
-
OUTPUT_PATH = 'output'
|
23
|
-
def base_path(fn = '')
|
24
|
-
File.join('.', fn)
|
25
|
-
end
|
26
|
-
def cache_path(fn = '')
|
27
|
-
File.join(base_path, CACHE_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
28
|
-
end
|
29
|
-
def document_path(fn = '')
|
30
|
-
File.join(base_path, DOCUMENT_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
31
|
-
end
|
32
|
-
def config_path(fn = '')
|
33
|
-
File.join(base_path, CONFIG_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
34
|
-
end
|
35
|
-
def layout_path(fn = '')
|
36
|
-
File.join(base_path, LAYOUT_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
37
|
-
end
|
38
|
-
def data_path(fn = '')
|
39
|
-
File.join(base_path, DATA_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
40
|
-
end
|
41
|
-
def output_path(fn = '')
|
42
|
-
File.join(base_path, OUTPUT_PATH, fn).sub(/^\.\//, '').sub(/\/$/, '')
|
43
|
-
end
|
44
|
-
end
|
45
|
-
module Logger
|
46
|
-
def logger
|
47
|
-
mock('logger',
|
48
|
-
:info => nil,
|
49
|
-
:error => nil,
|
50
|
-
:warn => nil,
|
51
|
-
:debug => nil)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
module Resource
|
55
|
-
include Path
|
56
|
-
def document_1
|
57
|
-
mock('document_1',
|
58
|
-
:source_fn => 'doc/pages/document_1',
|
59
|
-
:targets => { :html => nil, :text => nil },
|
60
|
-
:target_for => 'output/document_1.html',
|
61
|
-
:deps_for => ['doc/pages/document_1'],
|
62
|
-
:render => nil
|
63
|
-
)
|
64
|
-
end
|
65
|
-
def document_2
|
66
|
-
mock('document_2',
|
67
|
-
:source_fn => 'doc/pages/document_2',
|
68
|
-
:targets => { :html => nil },
|
69
|
-
:target_for => 'output/document_1.html',
|
70
|
-
:deps_for => ['doc/pages/document_2'],
|
71
|
-
:render => nil
|
72
|
-
)
|
73
|
-
end
|
74
|
-
def data_1
|
75
|
-
mock('data_1',
|
76
|
-
:target_fn => 'output/data_1',
|
77
|
-
:source_fn => 'doc/data/data_1'
|
78
|
-
)
|
79
|
-
end
|
80
|
-
def resource_factory
|
81
|
-
mock('resource_factory')
|
82
|
-
end
|
83
|
-
def filter_factory
|
84
|
-
mock('filter_factory')
|
85
|
-
end
|
86
|
-
end
|
87
|
-
module Cache
|
88
|
-
def cache
|
89
|
-
mock('cache', :load => nil,
|
90
|
-
:deps => { },
|
91
|
-
:add_dependency => nil)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
module Filter
|
95
|
-
def filter(output)
|
96
|
-
mock('filter', :filter => output)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
module Configuration
|
100
|
-
def configuration
|
101
|
-
{ :document_dir => 'doc/pages',
|
102
|
-
:data_dir => 'doc/data',
|
103
|
-
:layout_dir => 'doc/layouts',
|
104
|
-
:config_dir => 'doc/configs',
|
105
|
-
:cache_dir => '.cache',
|
106
|
-
:output_dir => 'output'
|
107
|
-
}
|
108
|
-
end
|
109
|
-
def merge_hashes(*hashes)
|
110
|
-
config = { }
|
111
|
-
hashes.each do |hash|
|
112
|
-
config.recursive_merge!(YAML::load(File.read(hash))) if File.exists?(hash.to_s)
|
113
|
-
config.recursive_merge!(hash) if hash.is_a?(Hash)
|
114
|
-
end
|
115
|
-
config.delete('config')
|
116
|
-
config
|
117
|
-
end
|
118
|
-
end
|
119
|
-
module CaptureOutput
|
120
|
-
def capture_stdout
|
121
|
-
s = StringIO.new
|
122
|
-
oldstdout = $stdout
|
123
|
-
$stdout = s
|
124
|
-
yield
|
125
|
-
s.string
|
126
|
-
ensure
|
127
|
-
$stdout = oldstdout
|
128
|
-
end
|
129
|
-
def capture_stderr
|
130
|
-
s = StringIO.new
|
131
|
-
oldstdout = $stderr
|
132
|
-
$stderr = s
|
133
|
-
yield
|
134
|
-
s.string
|
135
|
-
ensure
|
136
|
-
$stderr = oldstdout
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|