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
@@ -1,9 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::ContextTest < Nanoc::TestCase
3
+ class Nanoc::Int::ContextTest < Nanoc::TestCase
4
4
  def test_context_with_instance_variable
5
5
  # Create context
6
- context = Nanoc::Context.new({ foo: 'bar', baz: 'quux' })
6
+ context = Nanoc::Int::Context.new({ foo: 'bar', baz: 'quux' })
7
7
 
8
8
  # Ensure correct evaluation
9
9
  assert_equal('bar', eval('@foo', context.get_binding))
@@ -11,7 +11,7 @@ class Nanoc::ContextTest < Nanoc::TestCase
11
11
 
12
12
  def test_context_with_instance_method
13
13
  # Create context
14
- context = Nanoc::Context.new({ foo: 'bar', baz: 'quux' })
14
+ context = Nanoc::Int::Context.new({ foo: 'bar', baz: 'quux' })
15
15
 
16
16
  # Ensure correct evaluation
17
17
  assert_equal('bar', eval('foo', context.get_binding))
@@ -22,6 +22,6 @@ class Nanoc::ContextTest < Nanoc::TestCase
22
22
  YARD.parse(LIB_DIR + '/nanoc/base/context.rb')
23
23
 
24
24
  # Run
25
- assert_examples_correct 'Nanoc::Context#initialize'
25
+ assert_examples_correct 'Nanoc::Int::Context#initialize'
26
26
  end
27
27
  end
@@ -26,17 +26,27 @@ class Nanoc::DataSourceTest < Nanoc::TestCase
26
26
  # Test optional methods
27
27
  data_source.up
28
28
  data_source.down
29
- data_source.update
30
-
31
- # Test required methods - general
32
- assert_raises(NotImplementedError) { data_source.setup }
33
29
 
34
30
  # Test methods - loading data
35
31
  assert_equal [], data_source.items
36
32
  assert_equal [], data_source.layouts
33
+ end
34
+
35
+ def test_new_item
36
+ data_source = Nanoc::DataSource.new(nil, nil, nil, nil)
37
+
38
+ item = data_source.new_item('stuff', { title: 'Stuff!' }, '/asdf/')
39
+ assert_equal 'stuff', item.raw_content
40
+ assert_equal 'Stuff!', item.attributes[:title]
41
+ assert_equal Nanoc::Identifier.new('/asdf/'), item.identifier
42
+ end
43
+
44
+ def test_new_layout
45
+ data_source = Nanoc::DataSource.new(nil, nil, nil, nil)
37
46
 
38
- # Test required method - creating data
39
- assert_raises(NotImplementedError) { data_source.create_item(nil, nil, nil) }
40
- assert_raises(NotImplementedError) { data_source.create_layout(nil, nil, nil) }
47
+ layout = data_source.new_layout('stuff', { title: 'Stuff!' }, '/asdf/')
48
+ assert_equal 'stuff', layout.raw_content
49
+ assert_equal 'Stuff!', layout.attributes[:title]
50
+ assert_equal Nanoc::Identifier.new('/asdf/'), layout.identifier
41
51
  end
42
52
  end
@@ -1,12 +1,12 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::DependencyTrackerTest < Nanoc::TestCase
3
+ class Nanoc::Int::DependencyTrackerTest < Nanoc::TestCase
4
4
  def test_initialize
5
5
  # Mock items
6
6
  items = [mock, mock]
7
7
 
8
8
  # Create
9
- tracker = Nanoc::DependencyTracker.new(items)
9
+ tracker = Nanoc::Int::DependencyTracker.new(items)
10
10
 
11
11
  # Verify no dependencies yet
12
12
  assert_empty tracker.objects_causing_outdatedness_of(items[0])
@@ -18,7 +18,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
18
18
  items = [mock, mock]
19
19
 
20
20
  # Create
21
- tracker = Nanoc::DependencyTracker.new(items)
21
+ tracker = Nanoc::Int::DependencyTracker.new(items)
22
22
 
23
23
  # Record some dependencies
24
24
  tracker.record_dependency(items[0], items[1])
@@ -32,7 +32,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
32
32
  items = [mock, mock]
33
33
 
34
34
  # Create
35
- tracker = Nanoc::DependencyTracker.new(items)
35
+ tracker = Nanoc::Int::DependencyTracker.new(items)
36
36
 
37
37
  # Record some dependencies
38
38
  tracker.record_dependency(items[0], items[0])
@@ -47,7 +47,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
47
47
  items = [mock, mock]
48
48
 
49
49
  # Create
50
- tracker = Nanoc::DependencyTracker.new(items)
50
+ tracker = Nanoc::Int::DependencyTracker.new(items)
51
51
 
52
52
  # Record some dependencies
53
53
  tracker.record_dependency(items[0], items[1])
@@ -63,7 +63,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
63
63
  items = [mock, mock, mock]
64
64
 
65
65
  # Create
66
- tracker = Nanoc::DependencyTracker.new(items)
66
+ tracker = Nanoc::Int::DependencyTracker.new(items)
67
67
 
68
68
  # Record some dependencies
69
69
  tracker.record_dependency(items[0], items[1])
@@ -78,7 +78,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
78
78
  items = [mock, mock, mock]
79
79
 
80
80
  # Create
81
- tracker = Nanoc::DependencyTracker.new(items)
81
+ tracker = Nanoc::Int::DependencyTracker.new(items)
82
82
 
83
83
  # Record some dependencies
84
84
  tracker.record_dependency(items[0], items[1])
@@ -93,14 +93,14 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
93
93
  items = [mock, mock]
94
94
 
95
95
  # Create
96
- tracker = Nanoc::DependencyTracker.new(items)
96
+ tracker = Nanoc::Int::DependencyTracker.new(items)
97
97
 
98
98
  # Start, do something and stop
99
99
  tracker.start
100
- Nanoc::NotificationCenter.post(:visit_started, items[0])
101
- Nanoc::NotificationCenter.post(:visit_started, items[1])
102
- Nanoc::NotificationCenter.post(:visit_ended, items[1])
103
- Nanoc::NotificationCenter.post(:visit_ended, items[0])
100
+ Nanoc::Int::NotificationCenter.post(:visit_started, items[0])
101
+ Nanoc::Int::NotificationCenter.post(:visit_started, items[1])
102
+ Nanoc::Int::NotificationCenter.post(:visit_ended, items[1])
103
+ Nanoc::Int::NotificationCenter.post(:visit_ended, items[0])
104
104
  tracker.stop
105
105
 
106
106
  # Verify dependencies
@@ -118,7 +118,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
118
118
  items[3].stubs(:reference).returns([:item, '/ddd/'])
119
119
 
120
120
  # Create
121
- tracker = Nanoc::DependencyTracker.new(items)
121
+ tracker = Nanoc::Int::DependencyTracker.new(items)
122
122
 
123
123
  # Record some dependencies
124
124
  tracker.record_dependency(items[0], items[1])
@@ -126,14 +126,14 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
126
126
  tracker.record_dependency(items[1], items[3])
127
127
 
128
128
  # Store
129
- tracker.store_graph
129
+ tracker.store
130
130
  assert File.file?(tracker.filename)
131
131
 
132
132
  # Re-create
133
- tracker = Nanoc::DependencyTracker.new(items)
133
+ tracker = Nanoc::Int::DependencyTracker.new(items)
134
134
 
135
135
  # Load
136
- tracker.load_graph
136
+ tracker.load
137
137
 
138
138
  # Check loaded graph
139
139
  assert_contains_exactly [items[1]], tracker.objects_causing_outdatedness_of(items[0])
@@ -156,7 +156,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
156
156
  new_items = [items[0], items[1], items[2]]
157
157
 
158
158
  # Create
159
- tracker = Nanoc::DependencyTracker.new(old_items)
159
+ tracker = Nanoc::Int::DependencyTracker.new(old_items)
160
160
 
161
161
  # Record some dependencies
162
162
  tracker.record_dependency(old_items[0], old_items[1])
@@ -164,14 +164,14 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
164
164
  tracker.record_dependency(old_items[1], old_items[3])
165
165
 
166
166
  # Store
167
- tracker.store_graph
167
+ tracker.store
168
168
  assert File.file?(tracker.filename)
169
169
 
170
170
  # Re-create
171
- tracker = Nanoc::DependencyTracker.new(new_items)
171
+ tracker = Nanoc::Int::DependencyTracker.new(new_items)
172
172
 
173
173
  # Load
174
- tracker.load_graph
174
+ tracker.load
175
175
 
176
176
  # Check loaded graph
177
177
  assert_contains_exactly [items[1]], tracker.objects_causing_outdatedness_of(items[0])
@@ -188,21 +188,21 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
188
188
  items[2].stubs(:reference).returns([:item, '/ccc/'])
189
189
 
190
190
  # Create
191
- tracker = Nanoc::DependencyTracker.new(items)
191
+ tracker = Nanoc::Int::DependencyTracker.new(items)
192
192
 
193
193
  # Record some dependencies
194
194
  tracker.record_dependency(items[0], items[1])
195
195
  tracker.record_dependency(items[1], nil)
196
196
 
197
197
  # Store
198
- tracker.store_graph
198
+ tracker.store
199
199
  assert File.file?(tracker.filename)
200
200
 
201
201
  # Re-create
202
- tracker = Nanoc::DependencyTracker.new(items)
202
+ tracker = Nanoc::Int::DependencyTracker.new(items)
203
203
 
204
204
  # Load
205
- tracker.load_graph
205
+ tracker.load
206
206
 
207
207
  # Check loaded graph
208
208
  assert_contains_exactly [items[1]], tracker.objects_causing_outdatedness_of(items[0])
@@ -218,21 +218,21 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
218
218
  items[2].stubs(:reference).returns([:item, '/ccc/'])
219
219
 
220
220
  # Create
221
- tracker = Nanoc::DependencyTracker.new(items)
221
+ tracker = Nanoc::Int::DependencyTracker.new(items)
222
222
 
223
223
  # Record some dependencies
224
224
  tracker.record_dependency(items[0], items[1])
225
225
  tracker.record_dependency(nil, items[2])
226
226
 
227
227
  # Store
228
- tracker.store_graph
228
+ tracker.store
229
229
  assert File.file?(tracker.filename)
230
230
 
231
231
  # Re-create
232
- tracker = Nanoc::DependencyTracker.new(items)
232
+ tracker = Nanoc::Int::DependencyTracker.new(items)
233
233
 
234
234
  # Load
235
- tracker.load_graph
235
+ tracker.load
236
236
 
237
237
  # Check loaded graph
238
238
  assert_contains_exactly [items[1]], tracker.objects_causing_outdatedness_of(items[0])
@@ -244,7 +244,7 @@ class Nanoc::DependencyTrackerTest < Nanoc::TestCase
244
244
  items = [mock, mock, mock]
245
245
 
246
246
  # Create
247
- tracker = Nanoc::DependencyTracker.new(items)
247
+ tracker = Nanoc::Int::DependencyTracker.new(items)
248
248
 
249
249
  # Record some dependencies
250
250
  tracker.record_dependency(items[0], items[1])
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::DirectedGraphTest < Nanoc::TestCase
3
+ class Nanoc::Int::DirectedGraphTest < Nanoc::TestCase
4
4
  def test_direct_predecessors
5
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
5
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
6
6
  graph.add_edge(1, 2)
7
7
  graph.add_edge(2, 3)
8
8
 
@@ -12,7 +12,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
12
12
  end
13
13
 
14
14
  def test_predecessors
15
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
15
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
16
16
  graph.add_edge(1, 2)
17
17
  graph.add_edge(2, 3)
18
18
 
@@ -22,7 +22,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
22
22
  end
23
23
 
24
24
  def test_direct_successors
25
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
25
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
26
26
  graph.add_edge(1, 2)
27
27
  graph.add_edge(2, 3)
28
28
 
@@ -32,7 +32,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
32
32
  end
33
33
 
34
34
  def test_successors
35
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
35
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
36
36
  graph.add_edge(1, 2)
37
37
  graph.add_edge(2, 3)
38
38
 
@@ -42,7 +42,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
42
42
  end
43
43
 
44
44
  def test_edges
45
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
45
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
46
46
  graph.add_edge(1, 2)
47
47
  graph.add_edge(2, 3)
48
48
 
@@ -50,7 +50,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
50
50
  end
51
51
 
52
52
  def test_edges_with_new_vertices
53
- graph = Nanoc::DirectedGraph.new([1])
53
+ graph = Nanoc::Int::DirectedGraph.new([1])
54
54
  assert_equal [1], graph.vertices
55
55
  graph.add_edge(1, 2)
56
56
  assert_equal [1, 2], graph.vertices
@@ -61,7 +61,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
61
61
  end
62
62
 
63
63
  def test_add_edge
64
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
64
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
65
65
 
66
66
  assert_equal [], graph.successors_of(1)
67
67
  assert_equal [], graph.predecessors_of(2)
@@ -73,7 +73,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
73
73
  end
74
74
 
75
75
  def test_add_edge_with_new_vertices
76
- graph = Nanoc::DirectedGraph.new([1])
76
+ graph = Nanoc::Int::DirectedGraph.new([1])
77
77
  graph.add_edge(1, 2)
78
78
  graph.add_edge(3, 2)
79
79
 
@@ -82,7 +82,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
82
82
  end
83
83
 
84
84
  def test_delete_edge
85
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
85
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
86
86
  graph.add_edge(1, 2)
87
87
 
88
88
  assert_equal [2], graph.successors_of(1)
@@ -95,7 +95,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
95
95
  end
96
96
 
97
97
  def test_delete_edges_from
98
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
98
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
99
99
 
100
100
  graph.add_edge(1, 2)
101
101
  graph.add_edge(2, 1)
@@ -134,7 +134,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
134
134
  end
135
135
 
136
136
  def test_delete_edges_to
137
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
137
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
138
138
 
139
139
  graph.add_edge(1, 2)
140
140
  graph.add_edge(2, 1)
@@ -173,7 +173,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
173
173
  end
174
174
 
175
175
  def test_delete_vertex
176
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
176
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
177
177
 
178
178
  graph.add_edge(1, 2)
179
179
  graph.add_edge(2, 1)
@@ -192,7 +192,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
192
192
  end
193
193
 
194
194
  def test_delete_vertex_resulting_roots
195
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
195
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
196
196
  assert_equal Set.new([1, 2, 3]), graph.roots
197
197
 
198
198
  graph.add_edge(1, 2)
@@ -204,7 +204,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
204
204
  end
205
205
 
206
206
  def test_should_return_empty_array_for_nonexistant_vertices
207
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
207
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
208
208
 
209
209
  assert_equal [], graph.direct_predecessors_of(4)
210
210
  assert_equal [], graph.predecessors_of(4)
@@ -213,30 +213,30 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
213
213
  end
214
214
 
215
215
  def test_roots_after_init
216
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
216
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
217
217
 
218
218
  assert_equal Set.new([1, 2, 3]), graph.roots
219
219
  end
220
220
 
221
221
  def test_roots_after_adding_edge
222
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
222
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
223
223
  graph.add_edge(1, 2)
224
224
  assert_equal Set.new([1, 3]), graph.roots
225
225
 
226
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
226
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
227
227
  graph.add_edge(1, 3)
228
228
  assert_equal Set.new([1, 2]), graph.roots
229
229
 
230
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
230
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
231
231
  graph.add_edge(2, 1)
232
232
  assert_equal Set.new([2, 3]), graph.roots
233
233
 
234
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
234
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
235
235
  graph.add_edge(1, 2)
236
236
  graph.add_edge(2, 3)
237
237
  assert_equal Set.new([1]), graph.roots
238
238
 
239
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
239
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
240
240
  graph.add_edge(1, 2)
241
241
  graph.add_edge(2, 3)
242
242
  graph.add_edge(3, 1)
@@ -244,23 +244,23 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
244
244
  end
245
245
 
246
246
  def test_roots_after_removing_edge
247
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
247
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
248
248
  graph.add_edge(1, 2)
249
249
  graph.delete_edge(1, 2)
250
250
  assert_equal Set.new([1, 2, 3]), graph.roots
251
251
 
252
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
252
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
253
253
  graph.add_edge(1, 3)
254
254
  assert_equal Set.new([1, 2]), graph.roots
255
255
  graph.delete_edge(1, 2) # no such edge
256
256
  assert_equal Set.new([1, 2]), graph.roots
257
257
 
258
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
258
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
259
259
  graph.add_edge(2, 1)
260
260
  graph.delete_edge(2, 1)
261
261
  assert_equal Set.new([1, 2, 3]), graph.roots
262
262
 
263
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
263
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
264
264
  graph.add_edge(1, 2)
265
265
  graph.add_edge(2, 3)
266
266
  graph.delete_edge(1, 2)
@@ -268,7 +268,7 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
268
268
  graph.delete_edge(2, 3)
269
269
  assert_equal Set.new([1, 2, 3]), graph.roots
270
270
 
271
- graph = Nanoc::DirectedGraph.new([1, 2, 3])
271
+ graph = Nanoc::Int::DirectedGraph.new([1, 2, 3])
272
272
  graph.add_edge(1, 2)
273
273
  graph.add_edge(2, 3)
274
274
  graph.add_edge(3, 1)
@@ -282,6 +282,6 @@ class Nanoc::DirectedGraphTest < Nanoc::TestCase
282
282
 
283
283
  def test_example
284
284
  YARD.parse(LIB_DIR + '/nanoc/base/directed_graph.rb')
285
- assert_examples_correct 'Nanoc::DirectedGraph'
285
+ assert_examples_correct 'Nanoc::Int::DirectedGraph'
286
286
  end
287
287
  end