webgen 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/ChangeLog +487 -0
  2. data/Rakefile +13 -28
  3. data/VERSION +1 -1
  4. data/bin/webgen +1 -2
  5. data/data/webgen/passive_sources/templates/atom_feed.template +1 -0
  6. data/data/webgen/website_bundles/style/andreas07/src/default.css +2 -2
  7. data/data/webgen/website_skeleton/config.yaml +22 -5
  8. data/doc/contentprocessor.template +2 -2
  9. data/doc/contentprocessor/blocks.page +4 -4
  10. data/doc/contentprocessor/builder.page +2 -3
  11. data/doc/contentprocessor/erb.page +1 -1
  12. data/doc/contentprocessor/erubis.page +5 -5
  13. data/doc/contentprocessor/fragments.page +5 -4
  14. data/doc/contentprocessor/haml.page +2 -3
  15. data/doc/contentprocessor/head.page +16 -6
  16. data/doc/contentprocessor/kramdown.page +49 -0
  17. data/doc/contentprocessor/less.page +34 -0
  18. data/doc/contentprocessor/maruku.page +6 -3
  19. data/doc/contentprocessor/rdiscount.page +3 -3
  20. data/doc/contentprocessor/rdoc.page +1 -1
  21. data/doc/contentprocessor/redcloth.page +1 -1
  22. data/doc/contentprocessor/sass.page +1 -1
  23. data/doc/contentprocessor/tags.page +2 -2
  24. data/doc/contentprocessor/tidy.page +2 -2
  25. data/doc/extensions.page +1 -2
  26. data/doc/extensions.template +5 -5
  27. data/doc/getting_started.page +16 -12
  28. data/doc/index.page +21 -21
  29. data/doc/manual.page +109 -61
  30. data/doc/reference_configuration.page +63 -38
  31. data/doc/reference_metainfo.page +68 -45
  32. data/doc/reference_website_styles.page +5 -1
  33. data/doc/source/filesystem.page +4 -4
  34. data/doc/source/tararchive.page +4 -4
  35. data/doc/sourcehandler.template +2 -2
  36. data/doc/sourcehandler/feed.page +3 -4
  37. data/doc/sourcehandler/metainfo.page +1 -1
  38. data/doc/sourcehandler/page.page +3 -3
  39. data/doc/sourcehandler/sitemap.page +2 -3
  40. data/doc/sourcehandler/template.page +2 -2
  41. data/doc/sourcehandler/virtual.page +5 -5
  42. data/doc/tag.template +1 -1
  43. data/doc/tag/coderay.page +2 -2
  44. data/doc/tag/includefile.page +1 -1
  45. data/doc/tag/langbar.page +4 -1
  46. data/doc/tag/menu.page +3 -3
  47. data/doc/tag/relocatable.page +1 -1
  48. data/doc/upgrading.page +30 -31
  49. data/doc/webgen_page_format.page +6 -6
  50. data/lib/webgen/cache.rb +4 -5
  51. data/lib/webgen/cli/utils.rb +18 -7
  52. data/lib/webgen/cli/webgui_command.rb +4 -2
  53. data/lib/webgen/common.rb +10 -0
  54. data/lib/webgen/configuration.rb +1 -3
  55. data/lib/webgen/contentprocessor.rb +4 -2
  56. data/lib/webgen/contentprocessor/blocks.rb +1 -0
  57. data/lib/webgen/contentprocessor/builder.rb +3 -9
  58. data/lib/webgen/contentprocessor/erb.rb +3 -9
  59. data/lib/webgen/contentprocessor/erubis.rb +3 -9
  60. data/lib/webgen/contentprocessor/haml.rb +10 -11
  61. data/lib/webgen/contentprocessor/head.rb +64 -0
  62. data/lib/webgen/contentprocessor/kramdown.rb +26 -0
  63. data/lib/webgen/contentprocessor/kramdown/html.rb +32 -0
  64. data/lib/webgen/contentprocessor/less.rb +35 -0
  65. data/lib/webgen/contentprocessor/maruku.rb +14 -0
  66. data/lib/webgen/contentprocessor/tags.rb +25 -7
  67. data/lib/webgen/default_config.rb +9 -3
  68. data/lib/webgen/node.rb +92 -0
  69. data/lib/webgen/output.rb +3 -1
  70. data/lib/webgen/source/resource.rb +2 -1
  71. data/lib/webgen/source/tararchive.rb +3 -2
  72. data/lib/webgen/sourcehandler.rb +8 -4
  73. data/lib/webgen/sourcehandler/base.rb +1 -2
  74. data/lib/webgen/sourcehandler/feed.rb +1 -1
  75. data/lib/webgen/sourcehandler/virtual.rb +1 -0
  76. data/lib/webgen/tag/base.rb +1 -1
  77. data/lib/webgen/tag/langbar.rb +5 -2
  78. data/lib/webgen/version.rb +1 -1
  79. data/lib/webgen/website.rb +7 -8
  80. data/misc/default.template +1 -1
  81. data/misc/htmldoc.virtual +13 -1
  82. data/test/test_contentprocessor.rb +1 -1
  83. data/test/test_contentprocessor_blocks.rb +16 -1
  84. data/test/test_contentprocessor_erb.rb +1 -1
  85. data/test/test_contentprocessor_fragments.rb +1 -1
  86. data/test/test_contentprocessor_haml.rb +2 -2
  87. data/test/test_contentprocessor_head.rb +54 -8
  88. data/test/test_contentprocessor_kramdown.rb +50 -0
  89. data/test/test_contentprocessor_less.rb +40 -0
  90. data/test/test_contentprocessor_tags.rb +8 -0
  91. data/test/test_node.rb +102 -41
  92. data/test/test_source_tararchive.rb +5 -1
  93. data/test/test_sourcehandler_feed.rb +5 -2
  94. data/test/test_sourcehandler_virtual.rb +5 -0
  95. data/test/test_tag_langbar.rb +2 -3
  96. metadata +22 -16
  97. data/lib/webgen/deprecated.rb +0 -87
@@ -19,6 +19,9 @@ class TestSourceTarArchive < Test::Unit::TestCase
19
19
  stream.add_file('/other.page', :mtime => (Time.now - 4).to_i, :mode => 0100644) do |os, opts|
20
20
  os.write('This is other content!')
21
21
  end
22
+ stream.add_file('hallo.page', :mtime => (Time.now - 4).to_i, :mode => 0100644) do |os, opts|
23
+ os.write('This is the hallo.page!')
24
+ end
22
25
  sio.rewind
23
26
  sio
24
27
  end
@@ -42,9 +45,10 @@ class TestSourceTarArchive < Test::Unit::TestCase
42
45
 
43
46
  def test_paths
44
47
  source = Webgen::Source::TarArchive.new(@stream)
45
- assert_equal(3, source.paths.length)
48
+ assert_equal(4, source.paths.length)
46
49
  assert(source.paths.include?(Webgen::Path.new('/test/')))
47
50
  assert(source.paths.include?(Webgen::Path.new('/test/hallo.page')))
51
+ assert(source.paths.include?(Webgen::Path.new('/hallo.page')))
48
52
  assert_equal('This is the contents!', source.paths.find {|p| p.path == '/test/hallo.page'}.io.data)
49
53
 
50
54
  source = Webgen::Source::TarArchive.new(@stream, '/test/*')
@@ -27,8 +27,10 @@ EOF
27
27
  :root => root = Webgen::Node.new(@website.tree.dummy_root, '/', '/', {'index_path' => 'index.html'}),
28
28
  :file1_en => Webgen::Node.new(root, '/file1.en.html', 'file1.html', {'lang' => 'en', 'in_menu' => true, 'modified_at' => Time.now}),
29
29
  :index_en => Webgen::Node.new(root, '/index.en.html', 'index.html', {'lang' => 'en', 'modified_at' => Time.now - 1, 'author' => 'test'}),
30
+ :file2_en => Webgen::Node.new(root, '/file2.en.html', 'file2.html', {'lang' => 'en', 'modified_at' => Time.now - 2}),
30
31
  }
31
32
  @nodes[:index_en].node_info[:page] = Webgen::Page.from_data("--- name:content\nMyContent\n--- name:abstract\nRealContent")
33
+ @nodes[:file2_en].node_info[:page] = Webgen::Page.from_data("--- name:content\nCContent\n--- name:abstract\nAContent")
32
34
  @obj = Webgen::SourceHandler::Feed.new
33
35
  @path = path_with_meta_info('/test.feed', {}, @obj.class.name) {StringIO.new(FEED_CONTENT)}
34
36
  end
@@ -58,8 +60,8 @@ EOF
58
60
 
59
61
  def test_feed_entries
60
62
  atom_node, rss_node = @obj.create_node(@path)
61
- assert_equal([@nodes[:index_en]], atom_node.feed_entries)
62
- assert_equal([@nodes[:index_en]], rss_node.feed_entries)
63
+ assert_equal([@nodes[:index_en], @nodes[:file2_en]], atom_node.feed_entries)
64
+ assert_equal([@nodes[:index_en], @nodes[:file2_en]], rss_node.feed_entries)
63
65
  end
64
66
 
65
67
  def test_node_changed
@@ -75,6 +77,7 @@ EOF
75
77
  atom_node.unflag(:dirty)
76
78
  @nodes[:file1_en].unflag(:dirty)
77
79
  @nodes[:index_en].unflag(:dirty)
80
+ @nodes[:file2_en].unflag(:dirty)
78
81
  @website.tree['/templates/atom_feed.template'].unflag(:dirty)
79
82
  assert(!atom_node.changed?)
80
83
 
@@ -29,6 +29,10 @@ class TestSourceHandlerVirtual < Test::Unit::TestCase
29
29
  - other.html:
30
30
  url: directory/path.en.html
31
31
  title: Nothing
32
+
33
+ - /dirnew/dirnew/dirnew/:
34
+ url: /
35
+ title: root
32
36
  EOF
33
37
 
34
38
  def setup
@@ -52,6 +56,7 @@ EOF
52
56
  assert_not_nil(path_de)
53
57
  assert_not_nil(dir)
54
58
  assert_not_nil(path_en)
59
+ assert_not_nil(@root.tree['/dirnew/dirnew/dirnew/'])
55
60
 
56
61
  assert_equal('new title', path_en['title'])
57
62
  assert_equal(@time, path_en['modified_at'])
@@ -26,11 +26,10 @@ class TestTagLangbar < Test::Unit::TestCase
26
26
  nodes = create_default_nodes
27
27
 
28
28
  de_link = '<a href="index.de.html">de</a>'
29
- en_link = '<span>en</span>'
29
+ en_link = '<span class="webgen-langbar-current-lang">en</span>'
30
30
  check_results(nodes[:index_en], "#{de_link} | #{en_link}", de_link, "#{de_link} | #{en_link}", de_link)
31
31
 
32
- link = '<span>en</span>'
33
- check_results(nodes[:file_en], link, '', '', '')
32
+ check_results(nodes[:file_en], en_link, '', '', '')
34
33
 
35
34
  @obj.set_params('tag.langbar.show_single_lang' => true, 'tag.langbar.show_own_lang' => true, 'tag.langbar.separator' => ' --- ')
36
35
  assert_equal(["#{de_link} --- #{en_link}", false],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-10 00:00:00 +02:00
12
+ date: 2010-02-15 00:00:00 +01:00
13
13
  default_executable: webgen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -23,24 +23,24 @@ dependencies:
23
23
  version: 2.0.2
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
- name: maruku
26
+ name: kramdown
27
27
  type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "="
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.9
33
+ version: 0.5.0
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
- name: facets
37
- type: :runtime
36
+ name: maruku
37
+ type: :development
38
38
  version_requirement:
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "="
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.4.5
43
+ version: 0.6.0
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: rake
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: 1.0.0
93
+ version: 2.0.2
94
94
  version:
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: RedCloth
@@ -110,7 +110,7 @@ dependencies:
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 2.0.9
113
+ version: 2.2.7
114
114
  version:
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: builder
@@ -130,7 +130,7 @@ dependencies:
130
130
  requirements:
131
131
  - - ">="
132
132
  - !ruby/object:Gem::Version
133
- version: 2.4.2
133
+ version: 2.4.3
134
134
  version:
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: coderay
@@ -150,7 +150,7 @@ dependencies:
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: 2.6.2
153
+ version: 2.6.5
154
154
  version:
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: rdiscount
@@ -160,7 +160,7 @@ dependencies:
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
- version: 1.2.9
163
+ version: 1.3.5
164
164
  version:
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: archive-tar-minitar
@@ -312,6 +312,8 @@ files:
312
312
  - doc/contentprocessor/fragments.page
313
313
  - doc/contentprocessor/haml.page
314
314
  - doc/contentprocessor/head.page
315
+ - doc/contentprocessor/kramdown.page
316
+ - doc/contentprocessor/less.page
315
317
  - doc/contentprocessor/maruku.page
316
318
  - doc/contentprocessor/rdiscount.page
317
319
  - doc/contentprocessor/rdoc.page
@@ -376,6 +378,9 @@ files:
376
378
  - lib/webgen/contentprocessor/fragments.rb
377
379
  - lib/webgen/contentprocessor/haml.rb
378
380
  - lib/webgen/contentprocessor/head.rb
381
+ - lib/webgen/contentprocessor/kramdown/html.rb
382
+ - lib/webgen/contentprocessor/kramdown.rb
383
+ - lib/webgen/contentprocessor/less.rb
379
384
  - lib/webgen/contentprocessor/maruku.rb
380
385
  - lib/webgen/contentprocessor/rdiscount.rb
381
386
  - lib/webgen/contentprocessor/rdoc.rb
@@ -391,7 +396,6 @@ files:
391
396
  - lib/webgen/context.rb
392
397
  - lib/webgen/coreext.rb
393
398
  - lib/webgen/default_config.rb
394
- - lib/webgen/deprecated.rb
395
399
  - lib/webgen/error.rb
396
400
  - lib/webgen/languages.rb
397
401
  - lib/webgen/loggable.rb
@@ -465,6 +469,8 @@ files:
465
469
  - test/test_contentprocessor_fragments.rb
466
470
  - test/test_contentprocessor_haml.rb
467
471
  - test/test_contentprocessor_head.rb
472
+ - test/test_contentprocessor_kramdown.rb
473
+ - test/test_contentprocessor_less.rb
468
474
  - test/test_contentprocessor_maruku.rb
469
475
  - test/test_contentprocessor_rdiscount.rb
470
476
  - test/test_contentprocessor_rdoc.rb
@@ -553,7 +559,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
553
559
  requirements: []
554
560
 
555
561
  rubyforge_project: webgen
556
- rubygems_version: 1.3.2
562
+ rubygems_version: 1.3.5
557
563
  signing_key:
558
564
  specification_version: 3
559
565
  summary: webgen is a fast, powerful, and extensible static website generator.
@@ -1,87 +0,0 @@
1
- module Webgen
2
-
3
- class Node
4
-
5
- def flagged(key)
6
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Node#flagged? instead!")
7
- flagged?(key)
8
- end
9
-
10
- def absolute_cn
11
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Node#acn instead!")
12
- acn
13
- end
14
-
15
- def absolute_lcn
16
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Node#alcn instead!")
17
- alcn
18
- end
19
-
20
- end
21
-
22
- class Path
23
-
24
- def cnbase
25
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Path#basename instead!")
26
- @basename
27
- end
28
-
29
- def cnbase=(value)
30
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Path#basename= instead!")
31
- basename = value
32
- end
33
-
34
- end
35
-
36
- def self.const_missing(const)
37
- if const.to_s == 'Block'
38
- warn("Deprecation warning (~ #{caller.first}): Webgen::Block name will be removed in one of the next releases - use Webgen::Page::Block instead!")
39
- Webgen::Page::Block
40
- elsif const.to_s == "WebgenPageFormatError"
41
- warn("Deprecation warning (~ #{caller.first}): Webgen::WebgenPageFormatError name will be removed in one of the next releases - use Webgen::Page::FormatError instead!")
42
- Webgen::Page::FormatError
43
- else
44
- super
45
- end
46
- end
47
-
48
- module ContentProcessor
49
-
50
- def self.const_missing(const)
51
- if const.to_s == 'Context'
52
- warn("Deprecation warning (~ #{caller.first}): Webgen::ContentProcessor::Context is now named Webgen::Context! This alias will be removed in one of the next releases.")
53
- Webgen::Context
54
- else
55
- super
56
- end
57
- end
58
-
59
- module Deprecated
60
-
61
- def deprecate(old, new, obj)
62
- klass = Class.new
63
- klass.instance_methods.select {|m| m.to_s !~ /^(__|instance_eval|object_id)/}.each {|m| klass.__send__(:undef_method, m)}
64
- result = klass.new
65
- result.instance_eval { @old, @new, @obj = old, new, obj }
66
- def result.inspect; end
67
- def result.method_missing(sym, *args, &block)
68
- Kernel::warn("Deprecation warning (~ #{caller.first}): The alias '#{@old}' will be removed in one of the next releases - use '#{@new}' instead!")
69
- @obj.send(sym, *args, &block)
70
- end
71
- result
72
- end
73
-
74
- end
75
-
76
- end
77
-
78
- module Common
79
-
80
- def self.absolute_path(path, base)
81
- warn("Deprecation warning (~ #{caller.first}): this method will be removed in one of the next releases - use Webgen::Path.make_absolute(base, path) instead!")
82
- Path.make_absolute(base, path)
83
- end
84
-
85
- end
86
-
87
- end