webgen 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/webgen/content_processor/erubis.rb +13 -2
- data/lib/webgen/content_processor/kramdown.rb +15 -0
- data/lib/webgen/context.rb +1 -1
- data/lib/webgen/context/nodes.rb +3 -3
- data/lib/webgen/node.rb +3 -2
- data/lib/webgen/node_finder.rb +4 -5
- data/lib/webgen/path.rb +34 -24
- data/lib/webgen/path_handler.rb +8 -2
- data/lib/webgen/path_handler/virtual.rb +2 -2
- data/lib/webgen/tag/relocatable.rb +1 -1
- data/lib/webgen/version.rb +1 -1
- data/test/webgen/content_processor/test_erubis.rb +1 -1
- data/test/webgen/test_node_finder.rb +2 -0
- data/test/webgen/test_path.rb +5 -8
- metadata +49 -50
- data/test/webgen/content_processor/test_maruku.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a1b98190c63a1f48d1d1dccd972540408c621f0
|
4
|
+
data.tar.gz: 5b512539e92608915846a6ed88c42f4aca49fcf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a588782682753d0dab0ef0870202c1900c31de91968eedf05b3697d822614ca6a37ed5b689d6461f23d709cfd39c6ab065955499d73f650ef4b8b7ac596637c4
|
7
|
+
data.tar.gz: bb345850ff9514ef556e17f5b49e10a096451196419e0b351d1f36db462c0b4f505f591e913f7c2636a8073ded7c9cad07c93d13ac47ed58ad07dfc4e7e81c0b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
@@ -9,16 +9,27 @@ module Webgen
|
|
9
9
|
# Processes embedded Ruby statements with the +erubis+ library.
|
10
10
|
module Erubis
|
11
11
|
|
12
|
+
class CompatibleEruby < ::Erubis::Eruby #:nodoc:
|
13
|
+
include ::Erubis::ErboutEnhancer
|
14
|
+
include ::Erubis::PercentLineEnhancer
|
15
|
+
end
|
16
|
+
|
17
|
+
class CompatiblePIEruby < ::Erubis::PI::Eruby #:nodoc:
|
18
|
+
include ::Erubis::ErboutEnhancer
|
19
|
+
include ::Erubis::PercentLineEnhancer
|
20
|
+
end
|
21
|
+
|
12
22
|
# Including Erubis because of problem with resolving Erubis::XmlHelper et al
|
13
23
|
include ::Erubis
|
24
|
+
extend ::Erubis::XmlHelper
|
14
25
|
|
15
26
|
# Process the Ruby statements embedded in the content of +context+.
|
16
27
|
def self.call(context)
|
17
28
|
options = context.website.config['content_processor.erubis.options']
|
18
29
|
erubis = if context.website.config['content_processor.erubis.use_pi']
|
19
|
-
|
30
|
+
CompatiblePIEruby.new(context.content, options)
|
20
31
|
else
|
21
|
-
|
32
|
+
CompatibleEruby.new(context.content, options)
|
22
33
|
end
|
23
34
|
erubis.filename = context.ref_node.alcn
|
24
35
|
context.content = erubis.result(binding)
|
@@ -33,10 +33,25 @@ module Webgen
|
|
33
33
|
|
34
34
|
end
|
35
35
|
|
36
|
+
class ::Kramdown::Parser::WebgenKramdown < ::Kramdown::Parser::Kramdown #:nodoc:
|
37
|
+
|
38
|
+
LINK_DEFS_CACHE = {}
|
39
|
+
|
40
|
+
# Caching already normalized link definitions because this is potentially an O(n*m)
|
41
|
+
# operation where n...number of link definitions, m...number of invocations.
|
42
|
+
def update_link_definitions(link_defs)
|
43
|
+
link_defs.each do |k, v|
|
44
|
+
@link_defs[LINK_DEFS_CACHE[k] ||= normalize_link_id(k)] = v
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
36
50
|
# Convert the content in +context+ to HTML.
|
37
51
|
def self.call(context)
|
38
52
|
options = context.website.config['content_processor.kramdown.options'].dup
|
39
53
|
options[:link_defs] = context.website.ext.link_definitions.merge(options[:link_defs] || {})
|
54
|
+
options[:input] = 'WebgenKramdown'
|
40
55
|
doc = ::Kramdown::Document.new(context.content, options)
|
41
56
|
context.content = CustomHtmlConverter.new(doc.root, doc.options, context).convert(doc.root)
|
42
57
|
context.content.encode!(doc.root.options[:encoding])
|
data/lib/webgen/context.rb
CHANGED
@@ -73,7 +73,7 @@ module Webgen
|
|
73
73
|
def initialize(website, options = {}, persistent = {})
|
74
74
|
@website = website
|
75
75
|
(website.ext.context_modules || []).each {|m| self.extend(m)}
|
76
|
-
@options = {:content => ''}.merge(options)
|
76
|
+
@options = {:content => '', :chain => []}.merge(options)
|
77
77
|
@persistent = persistent
|
78
78
|
end
|
79
79
|
|
data/lib/webgen/context/nodes.rb
CHANGED
@@ -16,7 +16,7 @@ module Webgen
|
|
16
16
|
#
|
17
17
|
# The returned node should be used as source node for calculating relative paths to other nodes.
|
18
18
|
def dest_node
|
19
|
-
@options[:dest_node] ||
|
19
|
+
@options[:dest_node] || content_node
|
20
20
|
end
|
21
21
|
|
22
22
|
# Return the reference node, ie. the node which provided the original content for this context
|
@@ -24,14 +24,14 @@ module Webgen
|
|
24
24
|
#
|
25
25
|
# The returned node should be used, for example, for resolving relative paths.
|
26
26
|
def ref_node
|
27
|
-
@options[:chain]
|
27
|
+
@options[:chain][0]
|
28
28
|
end
|
29
29
|
|
30
30
|
# Return the node that is ultimately rendered.
|
31
31
|
#
|
32
32
|
# This node should be used, for example, for retrieving meta information.
|
33
33
|
def content_node
|
34
|
-
@options[:chain]
|
34
|
+
@options[:chain][-1]
|
35
35
|
end
|
36
36
|
alias :node :content_node
|
37
37
|
|
data/lib/webgen/node.rb
CHANGED
@@ -174,6 +174,7 @@ module Webgen
|
|
174
174
|
|
175
175
|
# resolve any '.' and '..' paths in the target url
|
176
176
|
if other_url.path =~ /\/\.\.?\// && other_url.scheme == 'webgen'
|
177
|
+
other_url = other_url.dup
|
177
178
|
other_url.path = Pathname.new(other_url.path).cleanpath.to_s
|
178
179
|
end
|
179
180
|
route = my_url.route_to(other_url).to_s
|
@@ -188,7 +189,7 @@ module Webgen
|
|
188
189
|
#
|
189
190
|
# If the +lang+ parameter is not used, it defaults to the language of the current node.
|
190
191
|
def proxy_node(lang = @lang)
|
191
|
-
|
192
|
+
@meta_info['proxy_path'] && resolve(@meta_info['proxy_path'], lang, true) || self
|
192
193
|
end
|
193
194
|
|
194
195
|
# Return a HTML link from this node to the given node.
|
@@ -207,7 +208,7 @@ module Webgen
|
|
207
208
|
attr = (rnode['link_attrs'].kind_of?(Hash) ? rnode['link_attrs'] : {}).merge(attr)
|
208
209
|
link_text = attr.delete('link_text') || (rnode != node && rnode['routed_title']) || node['title']
|
209
210
|
|
210
|
-
attr['href'] =
|
211
|
+
attr['href'] = route_to(node, lang)
|
211
212
|
attr['hreflang'] = rnode.lang.to_s if rnode.lang
|
212
213
|
attrs = attr.collect {|name,value| "#{name.to_s}=\"#{value}\"" }.sort.unshift('').join(' ')
|
213
214
|
"<a#{attrs}>#{link_text}</a>"
|
data/lib/webgen/node_finder.rb
CHANGED
@@ -287,7 +287,7 @@ module Webgen
|
|
287
287
|
nodes.unshift(node)
|
288
288
|
node = node.parent
|
289
289
|
end
|
290
|
-
result.nodes = nodes
|
290
|
+
result.nodes = nodes & result.nodes
|
291
291
|
end
|
292
292
|
|
293
293
|
def filter_descendants(result, ref_node, enabled)
|
@@ -295,8 +295,7 @@ module Webgen
|
|
295
295
|
result.ref_node_used = true
|
296
296
|
|
297
297
|
result.nodes.keep_if do |n|
|
298
|
-
n
|
299
|
-
n == ref_node
|
298
|
+
n.alcn.start_with?(ref_node.alcn)
|
300
299
|
end
|
301
300
|
end
|
302
301
|
|
@@ -307,9 +306,9 @@ module Webgen
|
|
307
306
|
if value == true
|
308
307
|
result.nodes.keep_if {|n| n.parent == ref_node.parent}
|
309
308
|
else
|
310
|
-
|
309
|
+
lower, upper = *[value].flatten.map {|i| (i = i.to_i) < 0 ? ref_node.level + 1 + i : i}
|
311
310
|
result.nodes.keep_if do |n|
|
312
|
-
n.level >=
|
311
|
+
n.level >= lower && n.level <= upper && (n.parent.is_ancestor_of?(ref_node) || n.is_root?)
|
313
312
|
end
|
314
313
|
end
|
315
314
|
end
|
data/lib/webgen/path.rb
CHANGED
@@ -38,31 +38,40 @@ module Webgen
|
|
38
38
|
# not escaped. This is needed so that paths with fragments work correctly.
|
39
39
|
URL_UNSAFE_PATTERN = Regexp.new("[^#{URI::PATTERN::UNRESERVED}#{URI::PATTERN::RESERVED}#]") # :nodoc:
|
40
40
|
|
41
|
-
#
|
42
|
-
|
41
|
+
# Hash that caches generated URLs
|
42
|
+
URL_CACHE = {} # :nodoc:
|
43
43
|
|
44
|
-
# Construct an internal URL for the given +path
|
44
|
+
# Construct an internal URL for the given +path+.
|
45
45
|
#
|
46
|
-
# If the parameter +make_absolute+ is +true+, then
|
47
|
-
#
|
46
|
+
# If the parameter +make_absolute+ is +true+, then the path will be made absolute by prepending
|
47
|
+
# the special URL 'webgen://lh'
|
48
48
|
def self.url(path, make_absolute = true)
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
URL_CACHE[[path, make_absolute]] ||= begin
|
50
|
+
if absolute?(path) || !make_absolute
|
51
|
+
URI.parse(URI::DEFAULT_PARSER.escape(path, URL_UNSAFE_PATTERN))
|
52
|
+
else
|
53
|
+
URI.parse(URI::DEFAULT_PARSER.escape("webgen://lh#{path[0] != ?/ ? '/' : ''}#{path}",
|
54
|
+
URL_UNSAFE_PATTERN))
|
55
|
+
end
|
56
|
+
end.freeze
|
57
|
+
end
|
58
|
+
|
59
|
+
# Return +true+ if the given URI is an absolute one, i.e. if it include a scheme.
|
60
|
+
def self.absolute?(uri)
|
61
|
+
uri =~ /\A[\w+.-]+:/
|
52
62
|
end
|
53
63
|
|
54
64
|
# Append the +path+ to the +base+ path.
|
55
65
|
#
|
56
|
-
# The +base+ parameter has to be an acn/alcn/absolute path.
|
57
|
-
#
|
58
|
-
# contain path patterns.
|
66
|
+
# * The +base+ parameter has to be an acn/alcn/absolute path (i.e. starting with a slash).
|
67
|
+
# * If +base+ represents a directory, it needs to have a trailing slash!
|
68
|
+
# * The +path+ parameter doesn't need to be absolute and may contain path patterns.
|
59
69
|
def self.append(base, path)
|
60
|
-
|
61
|
-
|
62
|
-
(url.path << (url.fragment.nil? ? '' : "##{url.fragment}")).encode!(path.encoding)
|
70
|
+
result = url(base) + url(path, false)
|
71
|
+
(result.fragment.nil? ? result.path : "#{result.path}##{result.fragment}").encode!(path.encoding)
|
63
72
|
end
|
64
73
|
|
65
|
-
# Return +true+ if the given path string matches the given path pattern.
|
74
|
+
# Return +true+ if the given path string matches the given non-empty path pattern.
|
66
75
|
#
|
67
76
|
# If a fragment path (i.e. one which has a hash character somewhere) should be matched, the
|
68
77
|
# pattern needs to have a hash character as well.
|
@@ -70,8 +79,9 @@ module Webgen
|
|
70
79
|
# For information on which patterns are supported, have a look at the API documentation of
|
71
80
|
# File.fnmatch.
|
72
81
|
def self.matches_pattern?(path, pattern, options = File::FNM_DOTMATCH|File::FNM_CASEFOLD|File::FNM_PATHNAME)
|
73
|
-
|
74
|
-
|
82
|
+
path = path.to_s
|
83
|
+
pattern += '/' if path[-1] == ?/ && pattern[-1] != ?/
|
84
|
+
(path.include?('#') ? pattern.include?('#') : true) && File.fnmatch(pattern, path, options)
|
75
85
|
end
|
76
86
|
|
77
87
|
# Construct a localized canonical name from a given canonical name and a language.
|
@@ -79,7 +89,7 @@ module Webgen
|
|
79
89
|
if lang.nil?
|
80
90
|
cn
|
81
91
|
else
|
82
|
-
cn.split('.').insert((cn
|
92
|
+
cn.split('.').insert((cn.start_with?('.') ? 2 : 1), lang.to_s).join('.')
|
83
93
|
end
|
84
94
|
end
|
85
95
|
|
@@ -185,7 +195,7 @@ module Webgen
|
|
185
195
|
#
|
186
196
|
# Triggers analyzation of the path if invoked.
|
187
197
|
def acn
|
188
|
-
if @path
|
198
|
+
if @path.include?('#')
|
189
199
|
self.class.new(parent_path).acn << cn
|
190
200
|
else
|
191
201
|
parent_path + cn
|
@@ -196,7 +206,7 @@ module Webgen
|
|
196
206
|
#
|
197
207
|
# Triggers analyzation of the path if invoked.
|
198
208
|
def alcn
|
199
|
-
if @path
|
209
|
+
if @path.include?('#')
|
200
210
|
self.class.new(parent_path).alcn << lcn
|
201
211
|
else
|
202
212
|
parent_path + lcn
|
@@ -287,9 +297,9 @@ module Webgen
|
|
287
297
|
|
288
298
|
# Analyse the path and extract the needed information.
|
289
299
|
def analyse
|
290
|
-
if @path
|
300
|
+
if @path.include?('#')
|
291
301
|
analyse_fragment
|
292
|
-
elsif @path
|
302
|
+
elsif @path[-1] == ?/
|
293
303
|
analyse_directory
|
294
304
|
else
|
295
305
|
analyse_file
|
@@ -297,7 +307,7 @@ module Webgen
|
|
297
307
|
@meta_info['title'] ||= @basename.tr('_-', ' ').capitalize
|
298
308
|
@ext ||= ''
|
299
309
|
raise "The basename of a path may not be empty: #{@path}" if @basename.empty? || @basename == '#'
|
300
|
-
raise "The parent path must start with a slash: #{@path}" if @path
|
310
|
+
raise "The parent path must start with a slash: #{@path}" if @path[0] != ?/
|
301
311
|
end
|
302
312
|
|
303
313
|
# Analyse the path assuming it is a directory.
|
@@ -327,7 +337,7 @@ module Webgen
|
|
327
337
|
# Analyse the path assuming it is a fragment.
|
328
338
|
def analyse_fragment
|
329
339
|
@parent_path, @basename = @path.scan(/^(.*?)(#.*?)$/).first
|
330
|
-
raise "The parent path of a fragment path must be a file path and not a directory path: #{@path}" if @parent_path
|
340
|
+
raise "The parent path of a fragment path must be a file path and not a directory path: #{@path}" if @parent_path[-1] == ?/
|
331
341
|
raise "A fragment path must only contain one hash character: #{path}" if @path.count("#") > 1
|
332
342
|
end
|
333
343
|
|
data/lib/webgen/path_handler.rb
CHANGED
@@ -214,6 +214,12 @@ module Webgen
|
|
214
214
|
@instances[handler.intern] ||= extension(handler).new(@website)
|
215
215
|
end
|
216
216
|
|
217
|
+
# Return the name of the give path handler instance.
|
218
|
+
def name_of_instance(instance)
|
219
|
+
@instances.rassoc(instance)[0] || 'unknown'
|
220
|
+
end
|
221
|
+
private :name_of_instance
|
222
|
+
|
217
223
|
|
218
224
|
# Populate the website tree with nodes.
|
219
225
|
#
|
@@ -277,10 +283,10 @@ module Webgen
|
|
277
283
|
@website.blackboard.dispatch_msg(:after_node_written, node, content)
|
278
284
|
rescue Webgen::Error => e
|
279
285
|
e.path = node.alcn if e.path.to_s.empty?
|
280
|
-
e.location = "path_handler.#{node.node_info[:path_handler]}" unless e.location
|
286
|
+
e.location = "path_handler.#{name_of_instance(node.node_info[:path_handler])}" unless e.location
|
281
287
|
raise
|
282
288
|
rescue Exception => e
|
283
|
-
raise Webgen::RenderError.new(e, "path_handler.#{node.node_info[:path_handler]}", node)
|
289
|
+
raise Webgen::RenderError.new(e, "path_handler.#{name_of_instance(node.node_info[:path_handler])}", node)
|
284
290
|
end
|
285
291
|
end
|
286
292
|
@website.blackboard.dispatch_msg(:after_all_nodes_written)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
|
-
require 'uri'
|
4
3
|
require 'yaml'
|
4
|
+
require 'webgen/path'
|
5
5
|
require 'webgen/path_handler/base'
|
6
6
|
require 'webgen/path_handler/page_utils'
|
7
7
|
|
@@ -31,7 +31,7 @@ module Webgen
|
|
31
31
|
parent_path = create_directories(File.dirname(key), 'modified_at' => meta_info['modified_at'])
|
32
32
|
|
33
33
|
dest_path = meta_info.delete('dest_path') || key
|
34
|
-
dest_path = if
|
34
|
+
dest_path = if Webgen::Path.absolute?(dest_path)
|
35
35
|
dest_path
|
36
36
|
elsif dest_path =~ /^\//
|
37
37
|
"webgen:#{dest_path}"
|
@@ -19,7 +19,7 @@ module Webgen
|
|
19
19
|
path = context[:config]['tag.relocatable.path']
|
20
20
|
result = ''
|
21
21
|
begin
|
22
|
-
result = (Webgen::Path.
|
22
|
+
result = (Webgen::Path.absolute?(path) ? path : resolve_path(path, context))
|
23
23
|
rescue URI::InvalidURIError => e
|
24
24
|
context.website.logger.warn do
|
25
25
|
["Could not parse path '#{path}' for tag.relocatable in <#{context.ref_node}>",
|
data/lib/webgen/version.rb
CHANGED
@@ -12,7 +12,7 @@ class TestErubis < Minitest::Test
|
|
12
12
|
@website.config.merge!('content_processor.erubis.options' => {}, 'content_processor.erubis.use_pi' => false)
|
13
13
|
cp = Webgen::ContentProcessor::Erubis
|
14
14
|
|
15
|
-
@context.content = "<%= context[:doit] %>6\n<%= context.ref_node.alcn %>\n<%= context.node.alcn %>\n<%= context.dest_node.alcn %><% context.website %>"
|
15
|
+
@context.content = "<%= context[:doit] %>6\n<%= h(context.ref_node.alcn) %>\n<%= context.node.alcn %>\n<%= context.dest_node.alcn %><% context.website %>"
|
16
16
|
assert_equal("hallo6\n/test\n/test\n/test", cp.call(@context).content)
|
17
17
|
|
18
18
|
@context.content = "\n<%= 5* %>"
|
@@ -133,6 +133,8 @@ class TestNodeFinder < Minitest::Test
|
|
133
133
|
# test filter: ancestors
|
134
134
|
check.call(%w[/ /dir/ /dir/dir/ /dir/dir/file.html],
|
135
135
|
@nf.find({:ancestors => true, :flatten => true}, tree['/dir/dir/file.html']))
|
136
|
+
check.call(%w[/dir/dir/],
|
137
|
+
@nf.find({:absolute_levels => 2, :ancestors => true, :flatten => true}, tree['/dir/dir/file.html']))
|
136
138
|
check.call(%w[/ /dir/ /dir/dir/],
|
137
139
|
@nf.find({:ancestors => true, :flatten => true}, tree['/dir/dir/']))
|
138
140
|
|
data/test/webgen/test_path.rb
CHANGED
@@ -8,12 +8,12 @@ require 'tmpdir'
|
|
8
8
|
class TestPath < Minitest::Test
|
9
9
|
|
10
10
|
def test_class_url
|
11
|
-
assert_equal("webgen://
|
12
|
-
assert_equal("webgen://
|
13
|
-
assert_equal("webgen://
|
14
|
-
assert_equal("webgen://
|
11
|
+
assert_equal("webgen://lh/hallo", Webgen::Path.url("hallo").to_s)
|
12
|
+
assert_equal("webgen://lh/hallo%20du", Webgen::Path.url("hallo du").to_s)
|
13
|
+
assert_equal("webgen://lh/hall%C3%B6chen", Webgen::Path.url("hallöchen").to_s)
|
14
|
+
assert_equal("webgen://lh/hallo#du", Webgen::Path.url("hallo#du").to_s)
|
15
15
|
|
16
|
-
assert_equal("webgen://
|
16
|
+
assert_equal("webgen://lh/test", Webgen::Path.url("/test").to_s)
|
17
17
|
assert_equal("http://example.com/test", Webgen::Path.url("http://example.com/test").to_s)
|
18
18
|
|
19
19
|
assert_equal("test", Webgen::Path.url("test", false).to_s)
|
@@ -21,8 +21,6 @@ class TestPath < Minitest::Test
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_class_append
|
24
|
-
assert_raises(ArgumentError) { Webgen::Path.append('test', 'test') }
|
25
|
-
assert_raises(ArgumentError) { Webgen::Path.append('test/', 'test') }
|
26
24
|
assert_equal('/', Webgen::Path.append('/', '/'))
|
27
25
|
assert_equal('/dir', Webgen::Path.append('/other', '/dir'))
|
28
26
|
assert_equal('/dir/', Webgen::Path.append('/other', '/dir/'))
|
@@ -56,7 +54,6 @@ class TestPath < Minitest::Test
|
|
56
54
|
|
57
55
|
path = '/'
|
58
56
|
assert(Webgen::Path.matches_pattern?(path, '/'))
|
59
|
-
assert(!Webgen::Path.matches_pattern?(path, ''))
|
60
57
|
|
61
58
|
path = ''
|
62
59
|
assert(!Webgen::Path.matches_pattern?(path, '/'))
|
metadata
CHANGED
@@ -1,257 +1,257 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Leitner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cmdparse
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
|
-
- -
|
20
|
+
- - '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.0.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '2.0'
|
30
|
-
- -
|
30
|
+
- - '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.0.5
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: systemu
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ~>
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '2.5'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ~>
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2.5'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: kramdown
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '1.3'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ~>
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: 0.8.3
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - '>='
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 0.8.3
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: minitest
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ~>
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '5.0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ~>
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '5.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: diff-lcs
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '1.0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '1.0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rubyforge
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '2.0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - ~>
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '2.0'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: maruku
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - ~>
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0.7'
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ~>
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0.7'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: RedCloth
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- -
|
135
|
+
- - ~>
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '4.1'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- -
|
142
|
+
- - ~>
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '4.1'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: haml
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
|
-
- -
|
149
|
+
- - ~>
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '4.0'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
|
-
- -
|
156
|
+
- - ~>
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '4.0'
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: sass
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- -
|
163
|
+
- - ~>
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '3.2'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
|
-
- -
|
170
|
+
- - ~>
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '3.2'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: builder
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- -
|
177
|
+
- - ~>
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '2.1'
|
180
180
|
type: :development
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
|
-
- -
|
184
|
+
- - ~>
|
185
185
|
- !ruby/object:Gem::Version
|
186
186
|
version: '2.1'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: rdoc
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
|
-
- -
|
191
|
+
- - ~>
|
192
192
|
- !ruby/object:Gem::Version
|
193
193
|
version: '4.0'
|
194
194
|
type: :development
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
|
-
- -
|
198
|
+
- - ~>
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '4.0'
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: coderay
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
|
-
- -
|
205
|
+
- - ~>
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '1.0'
|
208
208
|
type: :development
|
209
209
|
prerelease: false
|
210
210
|
version_requirements: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
|
-
- -
|
212
|
+
- - ~>
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '1.0'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
216
|
name: erubis
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
|
-
- -
|
219
|
+
- - ~>
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '2.6'
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
|
-
- -
|
226
|
+
- - ~>
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '2.6'
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: rdiscount
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
|
-
- -
|
233
|
+
- - ~>
|
234
234
|
- !ruby/object:Gem::Version
|
235
235
|
version: '1.3'
|
236
236
|
type: :development
|
237
237
|
prerelease: false
|
238
238
|
version_requirements: !ruby/object:Gem::Requirement
|
239
239
|
requirements:
|
240
|
-
- -
|
240
|
+
- - ~>
|
241
241
|
- !ruby/object:Gem::Version
|
242
242
|
version: '1.3'
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: archive-tar-minitar
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|
246
246
|
requirements:
|
247
|
-
- -
|
247
|
+
- - ~>
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: '0.5'
|
250
250
|
type: :development
|
251
251
|
prerelease: false
|
252
252
|
version_requirements: !ruby/object:Gem::Requirement
|
253
253
|
requirements:
|
254
|
-
- -
|
254
|
+
- - ~>
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '0.5'
|
257
257
|
description: |
|
@@ -266,17 +266,17 @@ extensions: []
|
|
266
266
|
extra_rdoc_files:
|
267
267
|
- API.rdoc
|
268
268
|
files:
|
269
|
-
-
|
269
|
+
- Rakefile
|
270
|
+
- setup.rb
|
271
|
+
- VERSION
|
270
272
|
- AUTHORS
|
273
|
+
- THANKS
|
271
274
|
- COPYING
|
272
275
|
- GPL
|
276
|
+
- API.rdoc
|
273
277
|
- README.md
|
274
|
-
- Rakefile
|
275
|
-
- THANKS
|
276
|
-
- VERSION
|
277
278
|
- bin/webgen
|
278
279
|
- data/webgen/basic_website_template/ext/init.rb
|
279
|
-
- data/webgen/basic_website_template/src/.gitignore
|
280
280
|
- data/webgen/basic_website_template/webgen.config
|
281
281
|
- data/webgen/bundle_template_files/README.md.erb
|
282
282
|
- data/webgen/bundle_template_files/Rakefile.erb
|
@@ -292,6 +292,7 @@ files:
|
|
292
292
|
- data/webgen/passive_sources/templates/sitemap.template
|
293
293
|
- data/webgen/passive_sources/templates/tag.template
|
294
294
|
- data/webgen/passive_sources/templates/tikz.template
|
295
|
+
- data/webgen/basic_website_template/src/.gitignore
|
295
296
|
- lib/webgen/blackboard.rb
|
296
297
|
- lib/webgen/bundle/built-in-show-changes/info.yaml
|
297
298
|
- lib/webgen/bundle/built-in-show-changes/init.rb
|
@@ -401,7 +402,6 @@ files:
|
|
401
402
|
- lib/webgen/version.rb
|
402
403
|
- lib/webgen/website.rb
|
403
404
|
- man/man1/webgen.1
|
404
|
-
- setup.rb
|
405
405
|
- test/test_documentation.rb
|
406
406
|
- test/webgen/cli/test_logger.rb
|
407
407
|
- test/webgen/content_processor/test_blocks.rb
|
@@ -412,7 +412,6 @@ files:
|
|
412
412
|
- test/webgen/content_processor/test_haml.rb
|
413
413
|
- test/webgen/content_processor/test_html_head.rb
|
414
414
|
- test/webgen/content_processor/test_kramdown.rb
|
415
|
-
- test/webgen/content_processor/test_maruku.rb
|
416
415
|
- test/webgen/content_processor/test_r_discount.rb
|
417
416
|
- test/webgen/content_processor/test_r_doc.rb
|
418
417
|
- test/webgen/content_processor/test_rainpress.rb
|
@@ -499,24 +498,24 @@ post_install_message: |2+
|
|
499
498
|
Have fun!
|
500
499
|
|
501
500
|
rdoc_options:
|
502
|
-
-
|
503
|
-
-
|
501
|
+
- --line-numbers
|
502
|
+
- --main
|
504
503
|
- API.rdoc
|
505
504
|
require_paths:
|
506
505
|
- lib
|
507
506
|
required_ruby_version: !ruby/object:Gem::Requirement
|
508
507
|
requirements:
|
509
|
-
- -
|
508
|
+
- - '>='
|
510
509
|
- !ruby/object:Gem::Version
|
511
510
|
version: 1.9.3
|
512
511
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
513
512
|
requirements:
|
514
|
-
- -
|
513
|
+
- - '>='
|
515
514
|
- !ruby/object:Gem::Version
|
516
515
|
version: '0'
|
517
516
|
requirements: []
|
518
517
|
rubyforge_project: webgen
|
519
|
-
rubygems_version: 2.
|
518
|
+
rubygems_version: 2.0.3
|
520
519
|
signing_key:
|
521
520
|
specification_version: 4
|
522
521
|
summary: webgen is a fast, powerful, and extensible static website generator.
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'webgen/test_helper'
|
4
|
-
|
5
|
-
class TestMaruku < Minitest::Test
|
6
|
-
|
7
|
-
include Webgen::TestHelper
|
8
|
-
|
9
|
-
def setup
|
10
|
-
require 'webgen/content_processor/maruku' rescue skip('Library maruku not installed')
|
11
|
-
setup_context
|
12
|
-
@cp = Webgen::ContentProcessor::Maruku
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_static_call
|
16
|
-
@context.content = '# header'
|
17
|
-
assert_equal('<h1 id=\'header\'>header</h1>', @cp.call(@context).content)
|
18
|
-
|
19
|
-
@context.content = "# head*d* {#das .dsaf "
|
20
|
-
assert_raises(MaRuKu::Exception) { @cp.call(@context) }
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_static_call_fix_for_invalid_id
|
24
|
-
@context.content = '# `test`'
|
25
|
-
assert_equal('<h1 id=\'id1\'><code>test</code></h1>', @cp.call(@context).content)
|
26
|
-
@context.content = '# `test`'
|
27
|
-
assert_equal('<h1 id=\'id1\'><code>test</code></h1>', @cp.call(@context).content)
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|