nanoc3 3.1.7 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/.gemtest +0 -0
  2. data/LICENSE +1 -1
  3. data/NEWS.md +9 -0
  4. data/doc/yardoc_templates/default/layout/html/footer.erb +10 -0
  5. data/lib/nanoc3/base/item.rb +1 -1
  6. data/lib/nanoc3/base/item_rep.rb +1 -0
  7. data/lib/nanoc3/base/layout.rb +1 -1
  8. data/lib/nanoc3/cli/base.rb +4 -2
  9. data/lib/nanoc3/cli/commands/view.rb +1 -0
  10. data/lib/nanoc3/data_sources/filesystem.rb +25 -6
  11. data/lib/nanoc3/data_sources/filesystem_unified.rb +5 -5
  12. data/lib/nanoc3/extra/validators/links.rb +1 -1
  13. data/lib/nanoc3/filters/rdiscount.rb +2 -1
  14. data/lib/nanoc3/filters/sass.rb +20 -8
  15. data/lib/nanoc3/filters/sass.rb.orig +75 -0
  16. data/lib/nanoc3.rb +1 -1
  17. data/nanoc3.gemspec +41 -0
  18. data/tasks/clean.rake +11 -0
  19. data/tasks/doc.rake +14 -0
  20. data/tasks/gem.rake +13 -0
  21. data/tasks/test.rake +38 -0
  22. data/test/base/core_ext/array_spec.rb +23 -0
  23. data/test/base/core_ext/hash_spec.rb +41 -0
  24. data/test/base/core_ext/string_spec.rb +27 -0
  25. data/test/base/test_code_snippet.rb +33 -0
  26. data/test/base/test_compiler.rb +410 -0
  27. data/test/base/test_compiler_dsl.rb +121 -0
  28. data/test/base/test_context.rb +33 -0
  29. data/test/base/test_data_source.rb +48 -0
  30. data/test/base/test_dependency_tracker.rb +510 -0
  31. data/test/base/test_directed_graph.rb +91 -0
  32. data/test/base/test_filter.rb +85 -0
  33. data/test/base/test_item.rb +141 -0
  34. data/test/base/test_item_rep.rb +953 -0
  35. data/test/base/test_layout.rb +44 -0
  36. data/test/base/test_notification_center.rb +36 -0
  37. data/test/base/test_plugin.rb +32 -0
  38. data/test/base/test_rule.rb +21 -0
  39. data/test/base/test_rule_context.rb +63 -0
  40. data/test/base/test_site.rb +366 -0
  41. data/test/cli/commands/test_compile.rb +12 -0
  42. data/test/cli/commands/test_create_item.rb +12 -0
  43. data/test/cli/commands/test_create_layout.rb +28 -0
  44. data/test/cli/commands/test_create_site.rb +24 -0
  45. data/test/cli/commands/test_help.rb +12 -0
  46. data/test/cli/commands/test_info.rb +12 -0
  47. data/test/cli/commands/test_update.rb +12 -0
  48. data/test/cli/test_logger.rb +12 -0
  49. data/test/data_sources/test_filesystem.rb +420 -0
  50. data/test/data_sources/test_filesystem_unified.rb +538 -0
  51. data/test/data_sources/test_filesystem_verbose.rb +359 -0
  52. data/test/extra/core_ext/test_enumerable.rb +32 -0
  53. data/test/extra/core_ext/test_time.rb +17 -0
  54. data/test/extra/deployers/test_rsync.rb +234 -0
  55. data/test/extra/test_auto_compiler.rb +482 -0
  56. data/test/extra/test_file_proxy.rb +21 -0
  57. data/test/extra/test_vcs.rb +24 -0
  58. data/test/extra/validators/test_links.rb +53 -0
  59. data/test/extra/validators/test_w3c.rb +49 -0
  60. data/test/filters/test_bluecloth.rb +20 -0
  61. data/test/filters/test_coderay.rb +46 -0
  62. data/test/filters/test_colorize_syntax.rb +56 -0
  63. data/test/filters/test_erb.rb +72 -0
  64. data/test/filters/test_erubis.rb +72 -0
  65. data/test/filters/test_haml.rb +98 -0
  66. data/test/filters/test_kramdown.rb +20 -0
  67. data/test/filters/test_less.rb +59 -0
  68. data/test/filters/test_markaby.rb +26 -0
  69. data/test/filters/test_maruku.rb +20 -0
  70. data/test/filters/test_rainpress.rb +31 -0
  71. data/test/filters/test_rdiscount.rb +33 -0
  72. data/test/filters/test_rdoc.rb +18 -0
  73. data/test/filters/test_redcloth.rb +20 -0
  74. data/test/filters/test_relativize_paths.rb +231 -0
  75. data/test/filters/test_rubypants.rb +20 -0
  76. data/test/filters/test_sass.rb +170 -0
  77. data/test/filters/test_sass.rb.orig +103 -0
  78. data/test/gem_loader.rb +11 -0
  79. data/test/helper.rb +99 -0
  80. data/test/helpers/test_blogging.rb +808 -0
  81. data/test/helpers/test_breadcrumbs.rb +83 -0
  82. data/test/helpers/test_capturing.rb +42 -0
  83. data/test/helpers/test_filtering.rb +108 -0
  84. data/test/helpers/test_html_escape.rb +18 -0
  85. data/test/helpers/test_link_to.rb +251 -0
  86. data/test/helpers/test_rendering.rb +109 -0
  87. data/test/helpers/test_tagging.rb +89 -0
  88. data/test/helpers/test_text.rb +26 -0
  89. data/test/helpers/test_xml_sitemap.rb +69 -0
  90. data/test/tasks/test_clean.rb +71 -0
  91. metadata +83 -8
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+
3
+ require 'test/helper'
4
+
5
+ class Nanoc3::Helpers::TextTest < MiniTest::Unit::TestCase
6
+
7
+ include Nanoc3::TestHelpers
8
+
9
+ include Nanoc3::Helpers::Text
10
+
11
+ def test_excerpt_length
12
+ assert_equal('...', excerptize('Foo bar baz quux meow woof', :length => 3))
13
+ assert_equal('Foo ...', excerptize('Foo bar baz quux meow woof', :length => 7))
14
+ assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', :length => 26))
15
+ assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', :length => 8623785))
16
+ end
17
+
18
+ def test_excerpt_omission
19
+ assert_equal('Foo [continued]', excerptize('Foo bar baz quux meow woof', :length => 15, :omission => '[continued]'))
20
+ end
21
+
22
+ def test_strip_html
23
+ # TODO implement
24
+ end
25
+
26
+ end
@@ -0,0 +1,69 @@
1
+ # encoding: utf-8
2
+
3
+ require 'test/helper'
4
+
5
+ class Nanoc3::Helpers::XMLSitemapTest < MiniTest::Unit::TestCase
6
+
7
+ include Nanoc3::TestHelpers
8
+
9
+ include Nanoc3::Helpers::XMLSitemap
10
+
11
+ def test_xml_sitemap
12
+ if_have 'builder' do
13
+ require 'time'
14
+
15
+ # Create items
16
+ @items = [ mock, mock, mock, mock ]
17
+
18
+ # Create item 0
19
+ @items[0].expects(:[]).with(:is_hidden).returns(false)
20
+ @items[0].expects(:mtime).times(2).returns(nil)
21
+ @items[0].expects(:[]).times(2).with(:changefreq).returns(nil)
22
+ @items[0].expects(:[]).times(2).with(:priority).returns(nil)
23
+ item_reps = [ mock, mock ]
24
+ item_reps[0].expects(:path).returns('/kkk/')
25
+ item_reps[0].expects(:raw_path).returns('output/kkk/index.html')
26
+ item_reps[1].expects(:path).returns('/lll/')
27
+ item_reps[1].expects(:raw_path).returns('output/lll/index.html')
28
+ @items[0].expects(:reps).returns(item_reps)
29
+
30
+ # Create item 1
31
+ @items[1].expects(:[]).with(:is_hidden).returns(true)
32
+
33
+ # Create item 2
34
+ @items[2].expects(:[]).with(:is_hidden).returns(false)
35
+ @items[2].expects(:mtime).times(4).returns(Time.parse('12/07/2004'))
36
+ @items[2].expects(:[]).with(:changefreq).times(4).returns('daily')
37
+ @items[2].expects(:[]).with(:priority).times(4).returns(0.5)
38
+ item_reps = [ mock, mock ]
39
+ item_reps[0].expects(:path).returns('/aaa/')
40
+ item_reps[0].expects(:raw_path).returns('output/aaa/index.html')
41
+ item_reps[1].expects(:path).returns('/bbb/')
42
+ item_reps[1].expects(:raw_path).returns('output/bbb/index.html')
43
+ @items[2].expects(:reps).returns(item_reps)
44
+
45
+ # Create item 3
46
+ @items[3].expects(:[]).with(:is_hidden).returns(false)
47
+ item_rep = mock
48
+ item_rep.expects(:raw_path).returns(nil)
49
+ @items[3].expects(:reps).returns([ item_rep ])
50
+
51
+ # Create sitemap item
52
+ @item = mock
53
+
54
+ # Create site
55
+ config = mock
56
+ config.expects(:[]).with(:base_url).at_least_once.returns('http://example.com')
57
+ @site = mock
58
+ @site.expects(:config).at_least_once.returns(config)
59
+
60
+ # Check
61
+ xml_sitemap
62
+ end
63
+ ensure
64
+ @items = nil
65
+ @item = nil
66
+ @site = nil
67
+ end
68
+
69
+ end
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+
3
+ require 'test/helper'
4
+
5
+ class Nanoc3::Tasks::CleanTest < MiniTest::Unit::TestCase
6
+
7
+ include Nanoc3::TestHelpers
8
+
9
+ def test_simple
10
+ if_have 'w3c_validators' do
11
+ # Stub items
12
+ items = [ mock, mock ]
13
+ reps = [ [ mock, mock ], [ mock, mock ] ]
14
+ items[0].expects(:reps).returns(reps[0])
15
+ items[1].expects(:reps).returns(reps[1])
16
+
17
+ # Create sample files
18
+ [ 0, 1 ].each do |item_id|
19
+ [ 0, 1 ].each do |rep_id|
20
+ filename = "item-#{item_id}-rep-#{rep_id}.txt"
21
+ reps[item_id][rep_id].expects(:raw_path).returns(filename)
22
+ File.open(filename, 'w') { |io| io.write('hello') }
23
+ assert File.file?(filename)
24
+ end
25
+ end
26
+
27
+ # Stub site
28
+ site = mock
29
+ site.expects(:load_data)
30
+ site.expects(:items).returns(items)
31
+
32
+ # Create clean task
33
+ clean = ::Nanoc3::Tasks::Clean.new(site)
34
+
35
+ # Run
36
+ clean.run
37
+
38
+ # Check
39
+ [ 0, 1 ].each do |item_id|
40
+ [ 0, 1 ].each do |rep_id|
41
+ filename = "item-#{item_id}-rep-#{rep_id}.txt"
42
+ assert !File.file?(filename)
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ def test_with_nil_raw_path
49
+ if_have 'w3c_validators' do
50
+ # Stub items
51
+ item = mock
52
+ rep = mock
53
+ item.expects(:reps).returns([ rep ])
54
+
55
+ # Create sample file
56
+ rep.expects(:raw_path).returns(nil)
57
+
58
+ # Stub site
59
+ site = mock
60
+ site.expects(:load_data)
61
+ site.expects(:items).returns([ item ])
62
+
63
+ # Create clean task
64
+ clean = ::Nanoc3::Tasks::Clean.new(site)
65
+
66
+ # Run
67
+ clean.run
68
+ end
69
+ end
70
+
71
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nanoc3
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.1.7
5
+ version: 3.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Denis Defreyne
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-03 00:00:00 +02:00
14
- default_executable: nanoc3
13
+ date: 2011-06-25 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: cri
@@ -19,9 +18,9 @@ dependencies:
19
18
  requirement: &id001 !ruby/object:Gem::Requirement
20
19
  none: false
21
20
  requirements:
22
- - - ">="
21
+ - - ~>
23
22
  - !ruby/object:Gem::Version
24
- version: 1.0.0
23
+ version: "1.0"
25
24
  type: :runtime
26
25
  version_requirements: *id001
27
26
  description:
@@ -41,6 +40,8 @@ files:
41
40
  - NEWS.md
42
41
  - Rakefile
43
42
  - README.md
43
+ - doc/yardoc_templates/default/layout/html/footer.erb
44
+ - bin/nanoc3
44
45
  - lib/nanoc3/base/code_snippet.rb
45
46
  - lib/nanoc3/base/compiler.rb
46
47
  - lib/nanoc3/base/compiler_dsl.rb
@@ -121,6 +122,7 @@ files:
121
122
  - lib/nanoc3/filters/relativize_paths.rb
122
123
  - lib/nanoc3/filters/rubypants.rb
123
124
  - lib/nanoc3/filters/sass.rb
125
+ - lib/nanoc3/filters/sass.rb.orig
124
126
  - lib/nanoc3/filters.rb
125
127
  - lib/nanoc3/helpers/blogging.rb
126
128
  - lib/nanoc3/helpers/breadcrumbs.rb
@@ -139,8 +141,81 @@ files:
139
141
  - lib/nanoc3/tasks/validate.rake
140
142
  - lib/nanoc3/tasks.rb
141
143
  - lib/nanoc3.rb
142
- - bin/nanoc3
143
- has_rdoc: yard
144
+ - tasks/clean.rake
145
+ - tasks/doc.rake
146
+ - tasks/gem.rake
147
+ - tasks/test.rake
148
+ - test/base/core_ext/array_spec.rb
149
+ - test/base/core_ext/hash_spec.rb
150
+ - test/base/core_ext/string_spec.rb
151
+ - test/base/test_code_snippet.rb
152
+ - test/base/test_compiler.rb
153
+ - test/base/test_compiler_dsl.rb
154
+ - test/base/test_context.rb
155
+ - test/base/test_data_source.rb
156
+ - test/base/test_dependency_tracker.rb
157
+ - test/base/test_directed_graph.rb
158
+ - test/base/test_filter.rb
159
+ - test/base/test_item.rb
160
+ - test/base/test_item_rep.rb
161
+ - test/base/test_layout.rb
162
+ - test/base/test_notification_center.rb
163
+ - test/base/test_plugin.rb
164
+ - test/base/test_rule.rb
165
+ - test/base/test_rule_context.rb
166
+ - test/base/test_site.rb
167
+ - test/cli/commands/test_compile.rb
168
+ - test/cli/commands/test_create_item.rb
169
+ - test/cli/commands/test_create_layout.rb
170
+ - test/cli/commands/test_create_site.rb
171
+ - test/cli/commands/test_help.rb
172
+ - test/cli/commands/test_info.rb
173
+ - test/cli/commands/test_update.rb
174
+ - test/cli/test_logger.rb
175
+ - test/data_sources/test_filesystem.rb
176
+ - test/data_sources/test_filesystem_unified.rb
177
+ - test/data_sources/test_filesystem_verbose.rb
178
+ - test/extra/core_ext/test_enumerable.rb
179
+ - test/extra/core_ext/test_time.rb
180
+ - test/extra/deployers/test_rsync.rb
181
+ - test/extra/test_auto_compiler.rb
182
+ - test/extra/test_file_proxy.rb
183
+ - test/extra/test_vcs.rb
184
+ - test/extra/validators/test_links.rb
185
+ - test/extra/validators/test_w3c.rb
186
+ - test/filters/test_bluecloth.rb
187
+ - test/filters/test_coderay.rb
188
+ - test/filters/test_colorize_syntax.rb
189
+ - test/filters/test_erb.rb
190
+ - test/filters/test_erubis.rb
191
+ - test/filters/test_haml.rb
192
+ - test/filters/test_kramdown.rb
193
+ - test/filters/test_less.rb
194
+ - test/filters/test_markaby.rb
195
+ - test/filters/test_maruku.rb
196
+ - test/filters/test_rainpress.rb
197
+ - test/filters/test_rdiscount.rb
198
+ - test/filters/test_rdoc.rb
199
+ - test/filters/test_redcloth.rb
200
+ - test/filters/test_relativize_paths.rb
201
+ - test/filters/test_rubypants.rb
202
+ - test/filters/test_sass.rb
203
+ - test/filters/test_sass.rb.orig
204
+ - test/gem_loader.rb
205
+ - test/helper.rb
206
+ - test/helpers/test_blogging.rb
207
+ - test/helpers/test_breadcrumbs.rb
208
+ - test/helpers/test_capturing.rb
209
+ - test/helpers/test_filtering.rb
210
+ - test/helpers/test_html_escape.rb
211
+ - test/helpers/test_link_to.rb
212
+ - test/helpers/test_rendering.rb
213
+ - test/helpers/test_tagging.rb
214
+ - test/helpers/test_text.rb
215
+ - test/helpers/test_xml_sitemap.rb
216
+ - test/tasks/test_clean.rb
217
+ - nanoc3.gemspec
218
+ - .gemtest
144
219
  homepage: http://nanoc.stoneship.org/
145
220
  licenses: []
146
221
 
@@ -179,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
254
  requirements: []
180
255
 
181
256
  rubyforge_project:
182
- rubygems_version: 1.5.0
257
+ rubygems_version: 1.8.5
183
258
  signing_key:
184
259
  specification_version: 3
185
260
  summary: a web publishing system written in Ruby for building small to medium-sized websites.