nanoc 3.8.0 → 4.0.0a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +322 -0
  4. data/NEWS.md +6 -0
  5. data/bin/nanoc +0 -18
  6. data/lib/nanoc.rb +5 -3
  7. data/lib/nanoc/base.rb +24 -6
  8. data/lib/nanoc/base/checksummer.rb +6 -4
  9. data/lib/nanoc/base/compilation/checksum_store.rb +4 -4
  10. data/lib/nanoc/base/compilation/compiled_content_cache.rb +5 -5
  11. data/lib/nanoc/base/compilation/compiler.rb +60 -65
  12. data/lib/nanoc/base/compilation/compiler_dsl.rb +11 -9
  13. data/lib/nanoc/base/compilation/dependency_tracker.rb +24 -38
  14. data/lib/nanoc/base/compilation/filter.rb +22 -7
  15. data/lib/nanoc/base/compilation/item_rep_proxy.rb +14 -12
  16. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +8 -8
  17. data/lib/nanoc/base/compilation/outdatedness_checker.rb +32 -32
  18. data/lib/nanoc/base/compilation/outdatedness_reasons.rb +3 -1
  19. data/lib/nanoc/base/compilation/rule.rb +9 -7
  20. data/lib/nanoc/base/compilation/rule_context.rb +15 -15
  21. data/lib/nanoc/base/compilation/rule_memory_calculator.rb +3 -3
  22. data/lib/nanoc/base/compilation/rule_memory_store.rb +7 -7
  23. data/lib/nanoc/base/compilation/rules_collection.rb +28 -30
  24. data/lib/nanoc/base/context.rb +2 -2
  25. data/lib/nanoc/base/core_ext/array.rb +17 -25
  26. data/lib/nanoc/base/core_ext/hash.rb +17 -25
  27. data/lib/nanoc/base/core_ext/pathname.rb +4 -2
  28. data/lib/nanoc/base/core_ext/string.rb +5 -3
  29. data/lib/nanoc/base/directed_graph.rb +4 -9
  30. data/lib/nanoc/base/error.rb +7 -0
  31. data/lib/nanoc/base/errors.rb +16 -23
  32. data/lib/nanoc/base/memoization.rb +4 -2
  33. data/lib/nanoc/base/notification_center.rb +3 -1
  34. data/lib/nanoc/base/plugin_registry.rb +14 -21
  35. data/lib/nanoc/base/result_data/item_rep.rb +43 -88
  36. data/lib/nanoc/base/source_data/code_snippet.rb +6 -4
  37. data/lib/nanoc/base/source_data/configuration.rb +3 -1
  38. data/lib/nanoc/base/source_data/data_source.rb +12 -94
  39. data/lib/nanoc/base/source_data/identifier.rb +50 -0
  40. data/lib/nanoc/base/source_data/item.rb +24 -67
  41. data/lib/nanoc/base/source_data/item_array.rb +6 -4
  42. data/lib/nanoc/base/source_data/layout.rb +17 -28
  43. data/lib/nanoc/base/source_data/site.rb +33 -44
  44. data/lib/nanoc/base/store.rb +3 -5
  45. data/lib/nanoc/base/temp_filename_factory.rb +3 -2
  46. data/lib/nanoc/base/views/config.rb +19 -0
  47. data/lib/nanoc/base/views/item.rb +77 -0
  48. data/lib/nanoc/base/views/item_collection.rb +43 -0
  49. data/lib/nanoc/base/views/item_rep.rb +125 -0
  50. data/lib/nanoc/base/views/layout.rb +42 -0
  51. data/lib/nanoc/base/views/layout_collection.rb +26 -0
  52. data/lib/nanoc/base/views/mutable_config.rb +9 -0
  53. data/lib/nanoc/base/views/mutable_item.rb +9 -0
  54. data/lib/nanoc/base/views/mutable_item_collection.rb +18 -0
  55. data/lib/nanoc/base/views/mutable_layout.rb +9 -0
  56. data/lib/nanoc/base/views/mutable_layout_collection.rb +18 -0
  57. data/lib/nanoc/base/views/site.rb +35 -0
  58. data/lib/nanoc/cli.rb +3 -6
  59. data/lib/nanoc/cli/ansi_string_colorizer.rb +2 -0
  60. data/lib/nanoc/cli/cleaning_stream.rb +2 -0
  61. data/lib/nanoc/cli/command_runner.rb +8 -42
  62. data/lib/nanoc/cli/commands/check.rb +2 -2
  63. data/lib/nanoc/cli/commands/compile.rb +19 -34
  64. data/lib/nanoc/cli/commands/create-site.rb +46 -83
  65. data/lib/nanoc/cli/commands/deploy.rb +4 -4
  66. data/lib/nanoc/cli/commands/shell.rb +1 -1
  67. data/lib/nanoc/cli/commands/show-plugins.rb +4 -6
  68. data/lib/nanoc/cli/error_handler.rb +4 -14
  69. data/lib/nanoc/cli/logger.rb +2 -0
  70. data/lib/nanoc/cli/stream_cleaners.rb +1 -0
  71. data/lib/nanoc/cli/stream_cleaners/abstract.rb +2 -0
  72. data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +2 -0
  73. data/lib/nanoc/cli/stream_cleaners/utf8.rb +2 -0
  74. data/lib/nanoc/data_sources.rb +1 -17
  75. data/lib/nanoc/data_sources/filesystem.rb +6 -37
  76. data/lib/nanoc/data_sources/filesystem_unified.rb +5 -3
  77. data/lib/nanoc/data_sources/filesystem_verbose.rb +5 -3
  78. data/lib/nanoc/data_sources/static.rb +4 -2
  79. data/lib/nanoc/extra.rb +1 -13
  80. data/lib/nanoc/extra/checking.rb +1 -0
  81. data/lib/nanoc/extra/checking/check.rb +4 -2
  82. data/lib/nanoc/extra/checking/checks.rb +1 -0
  83. data/lib/nanoc/extra/checking/checks/css.rb +1 -0
  84. data/lib/nanoc/extra/checking/checks/external_links.rb +2 -0
  85. data/lib/nanoc/extra/checking/checks/html.rb +1 -0
  86. data/lib/nanoc/extra/checking/checks/internal_links.rb +2 -0
  87. data/lib/nanoc/extra/checking/checks/mixed_content.rb +2 -0
  88. data/lib/nanoc/extra/checking/checks/stale.rb +1 -0
  89. data/lib/nanoc/extra/checking/dsl.rb +1 -0
  90. data/lib/nanoc/extra/checking/issue.rb +1 -0
  91. data/lib/nanoc/extra/checking/runner.rb +3 -3
  92. data/lib/nanoc/extra/core_ext/pathname.rb +5 -3
  93. data/lib/nanoc/extra/core_ext/time.rb +4 -2
  94. data/lib/nanoc/extra/deployer.rb +3 -1
  95. data/lib/nanoc/extra/deployers.rb +1 -0
  96. data/lib/nanoc/extra/deployers/fog.rb +2 -0
  97. data/lib/nanoc/extra/deployers/rsync.rb +2 -0
  98. data/lib/nanoc/extra/filesystem_tools.rb +3 -7
  99. data/lib/nanoc/extra/jruby_nokogiri_warner.rb +1 -0
  100. data/lib/nanoc/extra/link_collector.rb +1 -0
  101. data/lib/nanoc/extra/piper.rb +2 -1
  102. data/lib/nanoc/extra/pruner.rb +5 -3
  103. data/lib/nanoc/filters.rb +1 -2
  104. data/lib/nanoc/filters/asciidoc.rb +2 -0
  105. data/lib/nanoc/filters/bluecloth.rb +1 -0
  106. data/lib/nanoc/filters/coffeescript.rb +2 -0
  107. data/lib/nanoc/filters/colorize_syntax.rb +1 -12
  108. data/lib/nanoc/filters/erb.rb +2 -1
  109. data/lib/nanoc/filters/erubis.rb +2 -1
  110. data/lib/nanoc/filters/haml.rb +2 -1
  111. data/lib/nanoc/filters/handlebars.rb +2 -0
  112. data/lib/nanoc/filters/kramdown.rb +1 -0
  113. data/lib/nanoc/filters/less.rb +1 -0
  114. data/lib/nanoc/filters/markaby.rb +1 -0
  115. data/lib/nanoc/filters/maruku.rb +1 -0
  116. data/lib/nanoc/filters/mustache.rb +2 -0
  117. data/lib/nanoc/filters/pandoc.rb +1 -0
  118. data/lib/nanoc/filters/rainpress.rb +1 -0
  119. data/lib/nanoc/filters/rdiscount.rb +1 -0
  120. data/lib/nanoc/filters/rdoc.rb +1 -0
  121. data/lib/nanoc/filters/redcarpet.rb +2 -0
  122. data/lib/nanoc/filters/redcloth.rb +1 -0
  123. data/lib/nanoc/filters/relativize_paths.rb +1 -0
  124. data/lib/nanoc/filters/rubypants.rb +1 -0
  125. data/lib/nanoc/filters/sass.rb +1 -0
  126. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +2 -0
  127. data/lib/nanoc/filters/slim.rb +3 -1
  128. data/lib/nanoc/filters/typogruby.rb +2 -0
  129. data/lib/nanoc/filters/uglify_js.rb +1 -0
  130. data/lib/nanoc/filters/xsl.rb +2 -0
  131. data/lib/nanoc/filters/yui_compressor.rb +2 -0
  132. data/lib/nanoc/helpers/blogging.rb +30 -30
  133. data/lib/nanoc/helpers/breadcrumbs.rb +2 -2
  134. data/lib/nanoc/helpers/capturing.rb +6 -17
  135. data/lib/nanoc/helpers/filtering.rb +3 -3
  136. data/lib/nanoc/helpers/link_to.rb +3 -3
  137. data/lib/nanoc/helpers/rendering.rb +11 -11
  138. data/lib/nanoc/helpers/xml_sitemap.rb +3 -3
  139. data/lib/nanoc/tasks.rb +1 -0
  140. data/lib/nanoc/tasks/clean.rake +1 -1
  141. data/lib/nanoc/version.rb +1 -1
  142. data/tasks/doc.rake +2 -1
  143. data/tasks/test.rake +7 -1
  144. data/test/base/checksummer_spec.rb +15 -15
  145. data/test/base/core_ext/array_spec.rb +10 -10
  146. data/test/base/core_ext/hash_spec.rb +16 -16
  147. data/test/base/core_ext/pathname_spec.rb +2 -2
  148. data/test/base/core_ext/string_spec.rb +9 -9
  149. data/test/base/temp_filename_factory_spec.rb +3 -7
  150. data/test/base/test_checksum_store.rb +5 -5
  151. data/test/base/test_code_snippet.rb +3 -3
  152. data/test/base/test_compiler.rb +29 -29
  153. data/test/base/test_compiler_dsl.rb +23 -23
  154. data/test/base/test_context.rb +4 -4
  155. data/test/base/test_data_source.rb +17 -7
  156. data/test/base/test_dependency_tracker.rb +29 -29
  157. data/test/base/test_directed_graph.rb +27 -27
  158. data/test/base/test_item.rb +23 -21
  159. data/test/base/test_item_array.rb +18 -18
  160. data/test/base/test_item_rep.rb +76 -76
  161. data/test/base/test_item_rep_recorder_proxy.rb +4 -4
  162. data/test/base/test_layout.rb +8 -16
  163. data/test/base/test_memoization.rb +4 -4
  164. data/test/base/test_notification_center.rb +6 -6
  165. data/test/base/test_outdatedness_checker.rb +18 -18
  166. data/test/base/test_plugin.rb +1 -1
  167. data/test/base/test_rule.rb +2 -2
  168. data/test/base/test_rule_context.rb +5 -5
  169. data/test/base/test_site.rb +62 -38
  170. data/test/base/test_store.rb +2 -2
  171. data/test/cli/commands/test_check.rb +1 -1
  172. data/test/cli/commands/test_compile.rb +24 -18
  173. data/test/cli/commands/test_create_site.rb +5 -7
  174. data/test/cli/commands/test_deploy.rb +1 -1
  175. data/test/data_sources/test_filesystem.rb +22 -67
  176. data/test/data_sources/test_filesystem_unified.rb +10 -23
  177. data/test/data_sources/test_filesystem_verbose.rb +8 -53
  178. data/test/data_sources/test_static.rb +9 -9
  179. data/test/extra/checking/checks/test_stale.rb +1 -1
  180. data/test/extra/core_ext/test_pathname.rb +3 -3
  181. data/test/extra/core_ext/test_time.rb +4 -4
  182. data/test/extra/test_filesystem_tools.rb +1 -1
  183. data/test/filters/test_handlebars.rb +3 -3
  184. data/test/filters/test_less.rb +6 -6
  185. data/test/filters/test_mustache.rb +2 -2
  186. data/test/filters/test_relativize_paths.rb +81 -81
  187. data/test/filters/test_sass.rb +7 -7
  188. data/test/filters/test_xsl.rb +6 -6
  189. data/test/helper.rb +1 -1
  190. data/test/helpers/test_blogging.rb +78 -99
  191. data/test/helpers/test_breadcrumbs.rb +12 -12
  192. data/test/helpers/test_capturing.rb +10 -11
  193. data/test/helpers/test_filtering.rb +6 -6
  194. data/test/helpers/test_rendering.rb +3 -3
  195. data/test/helpers/test_tagging.rb +7 -7
  196. data/test/helpers/test_xml_sitemap.rb +34 -33
  197. metadata +19 -43
  198. data/lib/nanoc/cli/commands/autocompile.rb +0 -69
  199. data/lib/nanoc/cli/commands/create-item.rb +0 -55
  200. data/lib/nanoc/cli/commands/create-layout.rb +0 -68
  201. data/lib/nanoc/cli/commands/sync.rb +0 -32
  202. data/lib/nanoc/cli/commands/update.rb +0 -63
  203. data/lib/nanoc/cli/commands/validate-css.rb +0 -20
  204. data/lib/nanoc/cli/commands/validate-html.rb +0 -20
  205. data/lib/nanoc/cli/commands/validate-links.rb +0 -27
  206. data/lib/nanoc/cli/commands/watch.rb +0 -176
  207. data/lib/nanoc/data_sources/deprecated/delicious.rb +0 -38
  208. data/lib/nanoc/data_sources/deprecated/last_fm.rb +0 -85
  209. data/lib/nanoc/data_sources/deprecated/twitter.rb +0 -34
  210. data/lib/nanoc/extra/auto_compiler.rb +0 -99
  211. data/lib/nanoc/extra/chick.rb +0 -117
  212. data/lib/nanoc/extra/file_proxy.rb +0 -36
  213. data/lib/nanoc/extra/validators.rb +0 -8
  214. data/lib/nanoc/extra/validators/links.rb +0 -18
  215. data/lib/nanoc/extra/validators/w3c.rb +0 -23
  216. data/lib/nanoc/extra/vcs.rb +0 -62
  217. data/lib/nanoc/extra/vcses.rb +0 -15
  218. data/lib/nanoc/extra/vcses/bazaar.rb +0 -21
  219. data/lib/nanoc/extra/vcses/dummy.rb +0 -20
  220. data/lib/nanoc/extra/vcses/git.rb +0 -21
  221. data/lib/nanoc/extra/vcses/mercurial.rb +0 -21
  222. data/lib/nanoc/extra/vcses/subversion.rb +0 -21
  223. data/lib/nanoc/filters/coderay.rb +0 -19
  224. data/lib/nanoc3.rb +0 -3
  225. data/lib/nanoc3/cli.rb +0 -3
  226. data/lib/nanoc3/tasks.rb +0 -3
  227. data/test/cli/commands/test_create_item.rb +0 -10
  228. data/test/cli/commands/test_create_layout.rb +0 -24
  229. data/test/cli/commands/test_sync.rb +0 -27
  230. data/test/cli/commands/test_update.rb +0 -6
  231. data/test/cli/commands/test_watch.rb +0 -74
  232. data/test/extra/test_auto_compiler.rb +0 -437
  233. data/test/extra/test_vcs.rb +0 -18
  234. data/test/extra/validators/test_links.rb +0 -4
  235. data/test/extra/validators/test_w3c.rb +0 -37
  236. data/test/filters/test_coderay.rb +0 -40
@@ -4,36 +4,36 @@ class Nanoc::Helpers::BreadcrumbsTest < Nanoc::TestCase
4
4
  include Nanoc::Helpers::Breadcrumbs
5
5
 
6
6
  def test_breadcrumbs_trail_at_root
7
- @items = Nanoc::ItemArray.new
8
- @items << Nanoc::Item.new('root', {}, '/')
7
+ @items = Nanoc::Int::ItemArray.new
8
+ @items << Nanoc::Int::Item.new('root', {}, '/')
9
9
  @item = @items.last
10
10
 
11
11
  assert_equal [@items[0]], breadcrumbs_trail
12
12
  end
13
13
 
14
14
  def test_breadcrumbs_trail_with_1_parent
15
- @items = Nanoc::ItemArray.new
16
- @items << Nanoc::Item.new('parent', {}, '/')
17
- @items << Nanoc::Item.new('child', {}, '/foo/')
15
+ @items = Nanoc::Int::ItemArray.new
16
+ @items << Nanoc::Int::Item.new('parent', {}, '/')
17
+ @items << Nanoc::Int::Item.new('child', {}, '/foo/')
18
18
  @item = @items.last
19
19
 
20
20
  assert_equal [@items[0], @items[1]], breadcrumbs_trail
21
21
  end
22
22
 
23
23
  def test_breadcrumbs_trail_with_many_parents
24
- @items = Nanoc::ItemArray.new
25
- @items << Nanoc::Item.new('grandparent', {}, '/')
26
- @items << Nanoc::Item.new('parent', {}, '/foo/')
27
- @items << Nanoc::Item.new('child', {}, '/foo/bar/')
24
+ @items = Nanoc::Int::ItemArray.new
25
+ @items << Nanoc::Int::Item.new('grandparent', {}, '/')
26
+ @items << Nanoc::Int::Item.new('parent', {}, '/foo/')
27
+ @items << Nanoc::Int::Item.new('child', {}, '/foo/bar/')
28
28
  @item = @items.last
29
29
 
30
30
  assert_equal [@items[0], @items[1], @items[2]], breadcrumbs_trail
31
31
  end
32
32
 
33
33
  def test_breadcrumbs_trail_with_nils
34
- @items = Nanoc::ItemArray.new
35
- @items << Nanoc::Item.new('grandparent', {}, '/')
36
- @items << Nanoc::Item.new('child', {}, '/foo/bar/')
34
+ @items = Nanoc::Int::ItemArray.new
35
+ @items << Nanoc::Int::Item.new('grandparent', {}, '/')
36
+ @items << Nanoc::Int::Item.new('child', {}, '/foo/bar/')
37
37
  @item = @items.last
38
38
 
39
39
  assert_equal [@items[0], nil, @items[1]], breadcrumbs_trail
@@ -17,8 +17,8 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
17
17
  '<% end %> foot'
18
18
 
19
19
  # Build site
20
- @site = Nanoc3::Site.new({})
21
- @item = Nanoc::Item.new('moo', {}, '/blah/')
20
+ @site = Nanoc::Int::Site.new({})
21
+ @item = Nanoc::Int::Item.new('moo', {}, '/blah/')
22
22
  @item.site = @site
23
23
 
24
24
  # Evaluate content
@@ -26,7 +26,6 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
26
26
 
27
27
  # Check
28
28
  assert_equal '3', content_for(@item, :sidebar).strip
29
- assert_equal '3', @item[:content_for_sidebar].strip
30
29
  assert_match(/^head\s+foot$/, result)
31
30
  end
32
31
 
@@ -34,8 +33,8 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
34
33
  require 'erb'
35
34
 
36
35
  # Build site
37
- @site = Nanoc3::Site.new({})
38
- @item = Nanoc::Item.new('moo', {}, '/blah/')
36
+ @site = Nanoc::Int::Site.new({})
37
+ @item = Nanoc::Int::Item.new('moo', {}, '/blah/')
39
38
 
40
39
  # Capture
41
40
  _erbout = 'foo'
@@ -68,8 +67,8 @@ head
68
67
  foot
69
68
  EOS
70
69
 
71
- @site = Nanoc3::Site.new({})
72
- @item = Nanoc::Item.new('content', {}, '/')
70
+ @site = Nanoc::Int::Site.new({})
71
+ @item = Nanoc::Int::Item.new('content', {}, '/')
73
72
 
74
73
  result = ::ERB.new(content).result(binding)
75
74
 
@@ -86,16 +85,16 @@ EOS
86
85
  io.write "route '*' do ; item.identifier + 'index.html' ; end\n"
87
86
  end
88
87
 
89
- @site = Nanoc3::Site.new({})
90
- @item = Nanoc::Item.new('content', {}, '/')
88
+ @site = Nanoc::Int::Site.new({})
89
+ @item = Nanoc::Int::Item.new('content', {}, '/')
91
90
  content = '<% content_for :a do %>Content One<% end %>'
92
91
  ::ERB.new(content).result(binding)
93
92
 
94
93
  assert_equal 'Content One', content_for(@item, :a)
95
94
  assert_equal nil, content_for(@item, :b)
96
95
 
97
- @site = Nanoc3::Site.new({})
98
- @item = Nanoc::Item.new('content', {}, '/')
96
+ @site = Nanoc::Int::Site.new({})
97
+ @item = Nanoc::Int::Item.new('content', {}, '/')
99
98
  content = '<% content_for :b do %>Content Two<% end %>'
100
99
  ::ERB.new(content).result(binding)
101
100
 
@@ -60,7 +60,7 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
60
60
  "<% end %>\n"
61
61
 
62
62
  # Evaluate content
63
- assert_raises(Nanoc::Errors::UnknownFilter) do
63
+ assert_raises(Nanoc::Int::Errors::UnknownFilter) do
64
64
  ::ERB.new(content).result(binding)
65
65
  end
66
66
  end
@@ -68,8 +68,8 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
68
68
  def test_filter_with_arguments
69
69
  if_have 'coderay' do
70
70
  # Build content to be evaluated
71
- content = "<% filter :coderay, :language => 'ruby' do %>\n" \
72
- " def some_function ; x = blah.foo ; x.bar 'xyzzy' ; end\n" \
71
+ content = "<% filter :erb, locals: { sheep: 'baah' } do %>\n" \
72
+ " Sheep says <%%= @sheep %>!\n" \
73
73
  "<% end %>\n"
74
74
 
75
75
  # Mock item and rep
@@ -78,7 +78,7 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
78
78
 
79
79
  # Evaluate content
80
80
  result = ::ERB.new(content).result(binding)
81
- assert_match(%r{<span class="keyword">def</span> <span class="function">some_function</span>}, result)
81
+ assert_match(%r{Sheep says baah!}, result)
82
82
  end
83
83
  end
84
84
 
@@ -102,8 +102,8 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
102
102
 
103
103
  def test_notifications
104
104
  notifications = Set.new
105
- Nanoc::NotificationCenter.on(:filtering_started) { notifications << :filtering_started }
106
- Nanoc::NotificationCenter.on(:filtering_ended) { notifications << :filtering_ended }
105
+ Nanoc::Int::NotificationCenter.on(:filtering_started) { notifications << :filtering_started }
106
+ Nanoc::Int::NotificationCenter.on(:filtering_ended) { notifications << :filtering_ended }
107
107
 
108
108
  # Build content to be evaluated
109
109
  content = "<% filter :erb do %>\n" \
@@ -23,7 +23,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
23
23
  with_site do |site|
24
24
  @site = site
25
25
 
26
- assert_raises(Nanoc::Errors::UnknownLayout) do
26
+ assert_raises(Nanoc::Int::Errors::UnknownLayout) do
27
27
  render '/dsfghjkl/'
28
28
  end
29
29
  end
@@ -39,7 +39,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
39
39
 
40
40
  File.open('layouts/foo.erb', 'w').close
41
41
 
42
- assert_raises(Nanoc::Errors::CannotDetermineFilter) do
42
+ assert_raises(Nanoc::Int::Errors::CannotDetermineFilter) do
43
43
  render '/foo/'
44
44
  end
45
45
  end
@@ -55,7 +55,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
55
55
 
56
56
  File.open('layouts/foo.erb', 'w').close
57
57
 
58
- assert_raises(Nanoc::Errors::UnknownFilter) do
58
+ assert_raises(Nanoc::Int::Errors::UnknownFilter) do
59
59
  render '/foo/'
60
60
  end
61
61
  end
@@ -5,7 +5,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
5
5
 
6
6
  def test_tags_for_without_tags
7
7
  # Create item
8
- item = Nanoc::Item.new('content', {}, '/path/')
8
+ item = Nanoc::Int::Item.new('content', {}, '/path/')
9
9
 
10
10
  # Check
11
11
  assert_equal(
@@ -16,7 +16,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
16
16
 
17
17
  def test_tags_for_with_custom_base_url
18
18
  # Create item
19
- item = Nanoc::Item.new('content', { tags: %w(foo bar) }, '/path/')
19
+ item = Nanoc::Int::Item.new('content', { tags: %w(foo bar) }, '/path/')
20
20
 
21
21
  # Check
22
22
  assert_equal(
@@ -28,7 +28,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
28
28
 
29
29
  def test_tags_for_with_custom_none_text
30
30
  # Create item
31
- item = Nanoc::Item.new('content', { tags: [] }, '/path/')
31
+ item = Nanoc::Int::Item.new('content', { tags: [] }, '/path/')
32
32
 
33
33
  # Check
34
34
  assert_equal(
@@ -39,7 +39,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
39
39
 
40
40
  def test_tags_for_with_custom_separator
41
41
  # Create item
42
- item = Nanoc::Item.new('content', { tags: %w(foo bar) }, '/path/')
42
+ item = Nanoc::Int::Item.new('content', { tags: %w(foo bar) }, '/path/')
43
43
 
44
44
  # Check
45
45
  assert_equal(
@@ -52,9 +52,9 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
52
52
  def test_items_with_tag
53
53
  # Create items
54
54
  @items = [
55
- Nanoc::Item.new('item 1', { tags: [:foo] }, '/item1/'),
56
- Nanoc::Item.new('item 2', { tags: [:bar] }, '/item2/'),
57
- Nanoc::Item.new('item 3', { tags: [:foo, :bar] }, '/item3/')
55
+ Nanoc::Int::Item.new('item 1', { tags: [:foo] }, '/item1/'),
56
+ Nanoc::Int::Item.new('item 2', { tags: [:bar] }, '/item2/'),
57
+ Nanoc::Int::Item.new('item 3', { tags: [:foo, :bar] }, '/item3/')
58
58
  ]
59
59
 
60
60
  # Find items
@@ -17,28 +17,28 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
17
17
  @items = []
18
18
 
19
19
  # Create item 1
20
- @items << Nanoc::Item.new('some content 1', {}, '/item-one/')
21
- create_item_rep(@items.last, :one_a, '/item-one/a/')
22
- create_item_rep(@items.last, :one_b, '/item-one/b/')
20
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one/'))
21
+ create_item_rep(@items.last.unwrap, :one_a, '/item-one/a/')
22
+ create_item_rep(@items.last.unwrap, :one_b, '/item-one/b/')
23
23
 
24
24
  # Create item 2
25
- @items << Nanoc::Item.new('some content 2', { is_hidden: true }, '/item-two/')
25
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 2', { is_hidden: true }, '/item-two/'))
26
26
 
27
27
  # Create item 3
28
28
  attrs = { mtime: Time.parse('2004-07-12'), changefreq: 'daily', priority: 0.5 }
29
- @items << Nanoc::Item.new('some content 3', attrs, '/item-three/')
30
- create_item_rep(@items.last, :three_a, '/item-three/a/')
31
- create_item_rep(@items.last, :three_b, '/item-three/b/')
29
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 3', attrs, '/item-three/'))
30
+ create_item_rep(@items.last.unwrap, :three_a, '/item-three/a/')
31
+ create_item_rep(@items.last.unwrap, :three_b, '/item-three/b/')
32
32
 
33
33
  # Create item 4
34
- @items << Nanoc::Item.new('some content 4', {}, '/item-four/')
35
- create_item_rep(@items.last, :four_a, nil)
34
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 4', {}, '/item-four/'))
35
+ create_item_rep(@items.last.unwrap, :four_a, nil)
36
36
 
37
37
  # Create sitemap item
38
- @item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
38
+ @item = Nanoc::ItemView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'))
39
39
 
40
40
  # Create site
41
- @site = Nanoc::Site.new({ base_url: 'http://example.com' })
41
+ @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' })
42
42
 
43
43
  # Build sitemap
44
44
  res = xml_sitemap
@@ -73,16 +73,16 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
73
73
  # Create items
74
74
  @items = []
75
75
  @items << nil
76
- @items << Nanoc::Item.new('some content 1', {}, '/item-one/')
77
- create_item_rep(@items.last, :one_a, '/item-one/a/')
78
- create_item_rep(@items.last, :one_b, '/item-one/b/')
76
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one/'))
77
+ create_item_rep(@items.last.unwrap, :one_a, '/item-one/a/')
78
+ create_item_rep(@items.last.unwrap, :one_b, '/item-one/b/')
79
79
  @items << nil
80
80
 
81
81
  # Create sitemap item
82
- @item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
82
+ @item = Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/')
83
83
 
84
84
  # Create site
85
- @site = Nanoc::Site.new({ base_url: 'http://example.com' })
85
+ @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' })
86
86
 
87
87
  # Build sitemap
88
88
  res = xml_sitemap(items: [@items[1]])
@@ -107,15 +107,16 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
107
107
  def test_filter
108
108
  if_have 'builder', 'nokogiri' do
109
109
  # Create items
110
- @items = [Nanoc::Item.new('some content 1', {}, '/item-one/')]
111
- create_item_rep(@items.last, :one_a, '/item-one/a/')
112
- create_item_rep(@items.last, :one_b, '/item-one/b/')
110
+ @items = []
111
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one/'))
112
+ create_item_rep(@items.last.unwrap, :one_a, '/item-one/a/')
113
+ create_item_rep(@items.last.unwrap, :one_b, '/item-one/b/')
113
114
 
114
115
  # Create sitemap item
115
- @item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
116
+ @item = Nanoc::ItemView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'))
116
117
 
117
118
  # Create site
118
- @site = Nanoc::Site.new({ base_url: 'http://example.com' })
119
+ @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' })
119
120
 
120
121
  # Build sitemap
121
122
  res = xml_sitemap(rep_select: ->(rep) { rep.name == :one_a })
@@ -137,21 +138,21 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
137
138
  if_have 'builder', 'nokogiri' do
138
139
  # Create items
139
140
  @items = []
140
- @items << Nanoc::Item.new('some content 1', {}, '/george/')
141
- create_item_rep(@items.last, :a_alice, '/george/alice/')
142
- create_item_rep(@items.last, :b_zoey, '/george/zoey/')
143
- @items << Nanoc::Item.new('some content 1', {}, '/walton/')
144
- create_item_rep(@items.last, :a_eve, '/walton/eve/')
145
- create_item_rep(@items.last, :b_bob, '/walton/bob/')
146
- @items << Nanoc::Item.new('some content 1', {}, '/lucas/')
147
- create_item_rep(@items.last, :a_trudy, '/lucas/trudy/')
148
- create_item_rep(@items.last, :b_mallory, '/lucas/mallory/')
141
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/george/'))
142
+ create_item_rep(@items.last.unwrap, :a_alice, '/george/alice/')
143
+ create_item_rep(@items.last.unwrap, :b_zoey, '/george/zoey/')
144
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/walton/'))
145
+ create_item_rep(@items.last.unwrap, :a_eve, '/walton/eve/')
146
+ create_item_rep(@items.last.unwrap, :b_bob, '/walton/bob/')
147
+ @items << Nanoc::ItemView.new(Nanoc::Int::Item.new('some content 1', {}, '/lucas/'))
148
+ create_item_rep(@items.last.unwrap, :a_trudy, '/lucas/trudy/')
149
+ create_item_rep(@items.last.unwrap, :b_mallory, '/lucas/mallory/')
149
150
 
150
151
  # Create sitemap item
151
- @item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
152
+ @item = Nanoc::ItemView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'))
152
153
 
153
154
  # Create site
154
- @site = Nanoc::Site.new({ base_url: 'http://example.com' })
155
+ @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' })
155
156
 
156
157
  # Build sitemap
157
158
  res = xml_sitemap(items: @items)
@@ -174,7 +175,7 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
174
175
  protected
175
176
 
176
177
  def create_item_rep(item, name, path)
177
- rep = Nanoc::ItemRep.new(item, name)
178
+ rep = Nanoc::Int::ItemRep.new(item, name)
178
179
  rep.paths = { last: path }
179
180
  rep.raw_paths = { last: path }
180
181
  item.reps << rep
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 4.0.0a1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -61,6 +61,7 @@ files:
61
61
  - CONTRIBUTING.md
62
62
  - ChangeLog
63
63
  - Gemfile
64
+ - Gemfile.lock
64
65
  - LICENSE
65
66
  - NEWS.md
66
67
  - README.md
@@ -93,6 +94,7 @@ files:
93
94
  - lib/nanoc/base/core_ext/pathname.rb
94
95
  - lib/nanoc/base/core_ext/string.rb
95
96
  - lib/nanoc/base/directed_graph.rb
97
+ - lib/nanoc/base/error.rb
96
98
  - lib/nanoc/base/errors.rb
97
99
  - lib/nanoc/base/memoization.rb
98
100
  - lib/nanoc/base/notification_center.rb
@@ -101,21 +103,31 @@ files:
101
103
  - lib/nanoc/base/source_data/code_snippet.rb
102
104
  - lib/nanoc/base/source_data/configuration.rb
103
105
  - lib/nanoc/base/source_data/data_source.rb
106
+ - lib/nanoc/base/source_data/identifier.rb
104
107
  - lib/nanoc/base/source_data/item.rb
105
108
  - lib/nanoc/base/source_data/item_array.rb
106
109
  - lib/nanoc/base/source_data/layout.rb
107
110
  - lib/nanoc/base/source_data/site.rb
108
111
  - lib/nanoc/base/store.rb
109
112
  - lib/nanoc/base/temp_filename_factory.rb
113
+ - lib/nanoc/base/views/config.rb
114
+ - lib/nanoc/base/views/item.rb
115
+ - lib/nanoc/base/views/item_collection.rb
116
+ - lib/nanoc/base/views/item_rep.rb
117
+ - lib/nanoc/base/views/layout.rb
118
+ - lib/nanoc/base/views/layout_collection.rb
119
+ - lib/nanoc/base/views/mutable_config.rb
120
+ - lib/nanoc/base/views/mutable_item.rb
121
+ - lib/nanoc/base/views/mutable_item_collection.rb
122
+ - lib/nanoc/base/views/mutable_layout.rb
123
+ - lib/nanoc/base/views/mutable_layout_collection.rb
124
+ - lib/nanoc/base/views/site.rb
110
125
  - lib/nanoc/cli.rb
111
126
  - lib/nanoc/cli/ansi_string_colorizer.rb
112
127
  - lib/nanoc/cli/cleaning_stream.rb
113
128
  - lib/nanoc/cli/command_runner.rb
114
- - lib/nanoc/cli/commands/autocompile.rb
115
129
  - lib/nanoc/cli/commands/check.rb
116
130
  - lib/nanoc/cli/commands/compile.rb
117
- - lib/nanoc/cli/commands/create-item.rb
118
- - lib/nanoc/cli/commands/create-layout.rb
119
131
  - lib/nanoc/cli/commands/create-site.rb
120
132
  - lib/nanoc/cli/commands/deploy.rb
121
133
  - lib/nanoc/cli/commands/nanoc.rb
@@ -124,13 +136,7 @@ files:
124
136
  - lib/nanoc/cli/commands/show-data.rb
125
137
  - lib/nanoc/cli/commands/show-plugins.rb
126
138
  - lib/nanoc/cli/commands/show-rules.rb
127
- - lib/nanoc/cli/commands/sync.rb
128
- - lib/nanoc/cli/commands/update.rb
129
- - lib/nanoc/cli/commands/validate-css.rb
130
- - lib/nanoc/cli/commands/validate-html.rb
131
- - lib/nanoc/cli/commands/validate-links.rb
132
139
  - lib/nanoc/cli/commands/view.rb
133
- - lib/nanoc/cli/commands/watch.rb
134
140
  - lib/nanoc/cli/error_handler.rb
135
141
  - lib/nanoc/cli/logger.rb
136
142
  - lib/nanoc/cli/stream_cleaners.rb
@@ -138,15 +144,11 @@ files:
138
144
  - lib/nanoc/cli/stream_cleaners/ansi_colors.rb
139
145
  - lib/nanoc/cli/stream_cleaners/utf8.rb
140
146
  - lib/nanoc/data_sources.rb
141
- - lib/nanoc/data_sources/deprecated/delicious.rb
142
- - lib/nanoc/data_sources/deprecated/last_fm.rb
143
- - lib/nanoc/data_sources/deprecated/twitter.rb
144
147
  - lib/nanoc/data_sources/filesystem.rb
145
148
  - lib/nanoc/data_sources/filesystem_unified.rb
146
149
  - lib/nanoc/data_sources/filesystem_verbose.rb
147
150
  - lib/nanoc/data_sources/static.rb
148
151
  - lib/nanoc/extra.rb
149
- - lib/nanoc/extra/auto_compiler.rb
150
152
  - lib/nanoc/extra/checking.rb
151
153
  - lib/nanoc/extra/checking/check.rb
152
154
  - lib/nanoc/extra/checking/checks.rb
@@ -159,7 +161,6 @@ files:
159
161
  - lib/nanoc/extra/checking/dsl.rb
160
162
  - lib/nanoc/extra/checking/issue.rb
161
163
  - lib/nanoc/extra/checking/runner.rb
162
- - lib/nanoc/extra/chick.rb
163
164
  - lib/nanoc/extra/core_ext.rb
164
165
  - lib/nanoc/extra/core_ext/pathname.rb
165
166
  - lib/nanoc/extra/core_ext/time.rb
@@ -167,26 +168,14 @@ files:
167
168
  - lib/nanoc/extra/deployers.rb
168
169
  - lib/nanoc/extra/deployers/fog.rb
169
170
  - lib/nanoc/extra/deployers/rsync.rb
170
- - lib/nanoc/extra/file_proxy.rb
171
171
  - lib/nanoc/extra/filesystem_tools.rb
172
172
  - lib/nanoc/extra/jruby_nokogiri_warner.rb
173
173
  - lib/nanoc/extra/link_collector.rb
174
174
  - lib/nanoc/extra/piper.rb
175
175
  - lib/nanoc/extra/pruner.rb
176
- - lib/nanoc/extra/validators.rb
177
- - lib/nanoc/extra/validators/links.rb
178
- - lib/nanoc/extra/validators/w3c.rb
179
- - lib/nanoc/extra/vcs.rb
180
- - lib/nanoc/extra/vcses.rb
181
- - lib/nanoc/extra/vcses/bazaar.rb
182
- - lib/nanoc/extra/vcses/dummy.rb
183
- - lib/nanoc/extra/vcses/git.rb
184
- - lib/nanoc/extra/vcses/mercurial.rb
185
- - lib/nanoc/extra/vcses/subversion.rb
186
176
  - lib/nanoc/filters.rb
187
177
  - lib/nanoc/filters/asciidoc.rb
188
178
  - lib/nanoc/filters/bluecloth.rb
189
- - lib/nanoc/filters/coderay.rb
190
179
  - lib/nanoc/filters/coffeescript.rb
191
180
  - lib/nanoc/filters/colorize_syntax.rb
192
181
  - lib/nanoc/filters/erb.rb
@@ -230,9 +219,6 @@ files:
230
219
  - lib/nanoc/tasks/deploy/rsync.rake
231
220
  - lib/nanoc/tasks/validate.rake
232
221
  - lib/nanoc/version.rb
233
- - lib/nanoc3.rb
234
- - lib/nanoc3/cli.rb
235
- - lib/nanoc3/tasks.rb
236
222
  - nanoc.gemspec
237
223
  - tasks/doc.rake
238
224
  - tasks/rubocop.rake
@@ -267,16 +253,11 @@ files:
267
253
  - test/base/test_store.rb
268
254
  - test/cli/commands/test_check.rb
269
255
  - test/cli/commands/test_compile.rb
270
- - test/cli/commands/test_create_item.rb
271
- - test/cli/commands/test_create_layout.rb
272
256
  - test/cli/commands/test_create_site.rb
273
257
  - test/cli/commands/test_deploy.rb
274
258
  - test/cli/commands/test_help.rb
275
259
  - test/cli/commands/test_info.rb
276
260
  - test/cli/commands/test_prune.rb
277
- - test/cli/commands/test_sync.rb
278
- - test/cli/commands/test_update.rb
279
- - test/cli/commands/test_watch.rb
280
261
  - test/cli/test_cleaning_stream.rb
281
262
  - test/cli/test_cli.rb
282
263
  - test/cli/test_error_handler.rb
@@ -298,17 +279,12 @@ files:
298
279
  - test/extra/core_ext/test_time.rb
299
280
  - test/extra/deployers/test_fog.rb
300
281
  - test/extra/deployers/test_rsync.rb
301
- - test/extra/test_auto_compiler.rb
302
282
  - test/extra/test_file_proxy.rb
303
283
  - test/extra/test_filesystem_tools.rb
304
284
  - test/extra/test_link_collector.rb
305
285
  - test/extra/test_piper.rb
306
- - test/extra/test_vcs.rb
307
- - test/extra/validators/test_links.rb
308
- - test/extra/validators/test_w3c.rb
309
286
  - test/filters/test_asciidoc.rb
310
287
  - test/filters/test_bluecloth.rb
311
- - test/filters/test_coderay.rb
312
288
  - test/filters/test_coffeescript.rb
313
289
  - test/filters/test_colorize_syntax.rb
314
290
  - test/filters/test_erb.rb
@@ -370,9 +346,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
370
346
  version: 1.9.3
371
347
  required_rubygems_version: !ruby/object:Gem::Requirement
372
348
  requirements:
373
- - - ">="
349
+ - - ">"
374
350
  - !ruby/object:Gem::Version
375
- version: '0'
351
+ version: 1.3.1
376
352
  requirements: []
377
353
  rubyforge_project:
378
354
  rubygems_version: 2.4.6