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,30 +1,32 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::ItemTest < Nanoc::TestCase
3
+ class Nanoc::Int::ItemTest < Nanoc::TestCase
4
4
  def test_initialize_with_attributes_with_string_keys
5
- item = Nanoc::Item.new('foo', { 'abc' => 'xyz' }, '/foo/')
5
+ item = Nanoc::Int::Item.new('foo', { 'abc' => 'xyz' }, '/foo/')
6
6
 
7
7
  assert_equal nil, item.attributes['abc']
8
8
  assert_equal 'xyz', item.attributes[:abc]
9
9
  end
10
10
 
11
11
  def test_initialize_with_unclean_identifier
12
- item = Nanoc::Item.new('foo', {}, '/foo')
12
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
13
13
 
14
- assert_equal '/foo/', item.identifier
14
+ assert_equal '/foo/', item.identifier.to_s
15
15
  end
16
16
 
17
- def test_frozen_identifier
18
- item = Nanoc::Item.new('foo', {}, '/foo')
17
+ def test_reference
18
+ item = Nanoc::Int::Item.new(
19
+ 'content',
20
+ { one: 'one in item' },
21
+ '/path/'
22
+ )
19
23
 
20
- assert_raises_frozen_error do
21
- item.identifier.chop!
22
- end
24
+ assert_equal([:item, '/path/'], item.reference)
23
25
  end
24
26
 
25
27
  def test_lookup
26
28
  # Create item
27
- item = Nanoc::Item.new(
29
+ item = Nanoc::Int::Item.new(
28
30
  'content',
29
31
  { one: 'one in item' },
30
32
  '/path/'
@@ -38,7 +40,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
38
40
  end
39
41
 
40
42
  def test_set_attribute
41
- item = Nanoc::Item.new('foo', {}, '/foo')
43
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
42
44
  assert_equal nil, item[:motto]
43
45
 
44
46
  item[:motto] = 'More human than human'
@@ -56,7 +58,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
56
58
  end
57
59
 
58
60
  # Mock item
59
- item = Nanoc::Item.new('foo', {}, '/foo')
61
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
60
62
  item.expects(:reps).returns([rep])
61
63
 
62
64
  # Check
@@ -74,7 +76,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
74
76
  end
75
77
 
76
78
  # Mock item
77
- item = Nanoc::Item.new('foo', {}, '/foo')
79
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
78
80
  item.expects(:reps).returns([rep])
79
81
 
80
82
  # Check
@@ -92,7 +94,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
92
94
  end
93
95
 
94
96
  # Mock item
95
- item = Nanoc::Item.new('foo', {}, '/foo')
97
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
96
98
  item.expects(:reps).returns([rep])
97
99
 
98
100
  # Check
@@ -101,11 +103,11 @@ class Nanoc::ItemTest < Nanoc::TestCase
101
103
 
102
104
  def test_compiled_content_with_custom_nonexistant_rep
103
105
  # Mock item
104
- item = Nanoc::Item.new('foo', {}, '/foo')
106
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
105
107
  item.expects(:reps).returns([])
106
108
 
107
109
  # Check
108
- assert_raises(Nanoc::Errors::Generic) do
110
+ assert_raises(Nanoc::Int::Errors::Generic) do
109
111
  item.compiled_content(rep: :lkasdhflahgwfe)
110
112
  end
111
113
  end
@@ -117,7 +119,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
117
119
  rep.expects(:path).returns('the correct path')
118
120
 
119
121
  # Mock item
120
- item = Nanoc::Item.new('foo', {}, '/foo')
122
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
121
123
  item.expects(:reps).returns([rep])
122
124
 
123
125
  # Check
@@ -131,7 +133,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
131
133
  rep.expects(:path).returns('the correct path')
132
134
 
133
135
  # Mock item
134
- item = Nanoc::Item.new('foo', {}, '/foo')
136
+ item = Nanoc::Int::Item.new('foo', {}, '/foo')
135
137
  item.expects(:reps).returns([rep])
136
138
 
137
139
  # Check
@@ -139,7 +141,7 @@ class Nanoc::ItemTest < Nanoc::TestCase
139
141
  end
140
142
 
141
143
  def test_freeze_should_disallow_changes
142
- item = Nanoc::Item.new('foo', { a: { b: 123 } }, '/foo/')
144
+ item = Nanoc::Int::Item.new('foo', { a: { b: 123 } }, '/foo/')
143
145
  item.freeze
144
146
 
145
147
  assert_raises_frozen_error do
@@ -152,14 +154,14 @@ class Nanoc::ItemTest < Nanoc::TestCase
152
154
  end
153
155
 
154
156
  def test_dump_and_load
155
- item = Nanoc::Item.new(
157
+ item = Nanoc::Int::Item.new(
156
158
  'foobar',
157
159
  { a: { b: 123 } },
158
160
  '/foo/')
159
161
 
160
162
  item = Marshal.load(Marshal.dump(item))
161
163
 
162
- assert_equal '/foo/', item.identifier
164
+ assert_equal Nanoc::Identifier.new('/foo/'), item.identifier
163
165
  assert_equal 'foobar', item.raw_content
164
166
  assert_equal({ a: { b: 123 } }, item.attributes)
165
167
  end
@@ -1,13 +1,13 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::ItemArrayTest < Nanoc::TestCase
3
+ class Nanoc::Int::ItemArrayTest < Nanoc::TestCase
4
4
  def setup
5
5
  super
6
6
 
7
- @one = Nanoc::Item.new('Item One', {}, '/one/')
8
- @two = Nanoc::Item.new('Item Two', {}, '/two/')
7
+ @one = Nanoc::Int::Item.new('Item One', {}, '/one/')
8
+ @two = Nanoc::Int::Item.new('Item Two', {}, '/two/')
9
9
 
10
- @items = Nanoc::ItemArray.new
10
+ @items = Nanoc::Int::ItemArray.new
11
11
  @items << @one
12
12
  @items << @two
13
13
  end
@@ -97,7 +97,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
97
97
  end
98
98
 
99
99
  def test_regex
100
- foo = Nanoc::Item.new('Item Foo', {}, '/foo/')
100
+ foo = Nanoc::Int::Item.new('Item Foo', {}, '/foo/')
101
101
  @items << foo
102
102
 
103
103
  assert_equal [@one], @items[/n/]
@@ -108,7 +108,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
108
108
  assert_nil @items[2]
109
109
  assert_nil @items['/foo/']
110
110
 
111
- foo = Nanoc::Item.new('Item Foo', {}, '/foo/')
111
+ foo = Nanoc::Int::Item.new('Item Foo', {}, '/foo/')
112
112
  @items << foo
113
113
 
114
114
  assert_equal foo, @items[2]
@@ -117,10 +117,10 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
117
117
 
118
118
  def test_assign
119
119
  assert_raises(TypeError) do
120
- @items['/blah/'] = Nanoc::Item.new('Item blah', {}, '/blah/')
120
+ @items['/blah/'] = Nanoc::Int::Item.new('Item blah', {}, '/blah/')
121
121
  end
122
122
 
123
- new_item = Nanoc::Item.new('New Item One', {}, '/one-new/')
123
+ new_item = Nanoc::Int::Item.new('New Item One', {}, '/one-new/')
124
124
  @items[0] = new_item
125
125
 
126
126
  assert_equal new_item, @items[0]
@@ -131,7 +131,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
131
131
  def test_assign_frozen
132
132
  @items.freeze
133
133
 
134
- new_item = Nanoc::Item.new('New Item One', {}, '/one-new/')
134
+ new_item = Nanoc::Int::Item.new('New Item One', {}, '/one-new/')
135
135
 
136
136
  assert_raises_frozen_error do
137
137
  @items[0] = new_item
@@ -151,7 +151,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
151
151
 
152
152
  def test_collect_bang
153
153
  @items.collect! do |i|
154
- Nanoc::Item.new("New #{i.raw_content}", {}, "/new#{i.identifier}")
154
+ Nanoc::Int::Item.new("New #{i.raw_content}", {}, "/new#{i.identifier}")
155
155
  end
156
156
 
157
157
  assert_nil @items['/one/']
@@ -169,13 +169,13 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
169
169
 
170
170
  assert_raises_frozen_error do
171
171
  @items.collect! do |i|
172
- Nanoc::Item.new("New #{i.raw_content}", {}, "/new#{i.identifier}")
172
+ Nanoc::Int::Item.new("New #{i.raw_content}", {}, "/new#{i.identifier}")
173
173
  end
174
174
  end
175
175
  end
176
176
 
177
177
  def test_concat
178
- new_item = Nanoc::Item.new('New item', {}, '/new/')
178
+ new_item = Nanoc::Int::Item.new('New item', {}, '/new/')
179
179
  @items.concat([new_item])
180
180
 
181
181
  assert_equal new_item, @items[2]
@@ -213,7 +213,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
213
213
  end
214
214
 
215
215
  def test_fill_all
216
- @items.fill { |i| Nanoc::Item.new("Item #{i}", {}, "/new/#{i}/") }
216
+ @items.fill { |i| Nanoc::Int::Item.new("Item #{i}", {}, "/new/#{i}/") }
217
217
 
218
218
  assert_nil @items['/one/']
219
219
  assert_nil @items['/two/']
@@ -225,7 +225,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
225
225
  end
226
226
 
227
227
  def test_fill_range
228
- @items.fill(1..-1) { |i| Nanoc::Item.new("Item #{i}", {}, "/new/#{i}/") }
228
+ @items.fill(1..-1) { |i| Nanoc::Int::Item.new("Item #{i}", {}, "/new/#{i}/") }
229
229
 
230
230
  assert_equal @one, @items['/one/']
231
231
  assert_nil @items['/two/']
@@ -260,7 +260,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
260
260
  end
261
261
 
262
262
  def test_push
263
- pushy = Nanoc::Item.new('Pushy', {}, '/pushy/')
263
+ pushy = Nanoc::Int::Item.new('Pushy', {}, '/pushy/')
264
264
  @items.push(pushy)
265
265
 
266
266
  assert_equal @one, @items[0]
@@ -282,8 +282,8 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
282
282
  end
283
283
 
284
284
  def test_replace
285
- max = Nanoc::Item.new('Max', {}, '/max/')
286
- mona = Nanoc::Item.new('Mona', {}, '/mona/')
285
+ max = Nanoc::Int::Item.new('Max', {}, '/max/')
286
+ mona = Nanoc::Int::Item.new('Mona', {}, '/mona/')
287
287
 
288
288
  @items.replace([max, mona])
289
289
 
@@ -327,7 +327,7 @@ class Nanoc::ItemArrayTest < Nanoc::TestCase
327
327
  end
328
328
 
329
329
  def test_unshift
330
- unshifty = Nanoc::Item.new('Unshifty', {}, '/unshifty/')
330
+ unshifty = Nanoc::Int::Item.new('Unshifty', {}, '/unshifty/')
331
331
  @items.unshift(unshifty)
332
332
 
333
333
  assert_equal unshifty, @items[0]
@@ -1,17 +1,17 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::ItemRepTest < Nanoc::TestCase
3
+ class Nanoc::Int::ItemRepTest < Nanoc::TestCase
4
4
  def test_created_modified_compiled
5
5
  # TODO: implement
6
6
  end
7
7
 
8
8
  def test_compiled_content_with_only_last_available
9
9
  # Create rep
10
- item = Nanoc::Item.new(
10
+ item = Nanoc::Int::Item.new(
11
11
  'blah blah blah', {}, '/',
12
12
  binary: false, mtime: Time.now - 500
13
13
  )
14
- rep = Nanoc::ItemRep.new(item, nil)
14
+ rep = Nanoc::Int::ItemRep.new(item, nil)
15
15
  rep.instance_eval { @content = { last: 'last content' } }
16
16
  rep.expects(:compiled?).returns(true)
17
17
 
@@ -21,11 +21,11 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
21
21
 
22
22
  def test_compiled_content_with_pre_and_last_available
23
23
  # Create rep
24
- item = Nanoc::Item.new(
24
+ item = Nanoc::Int::Item.new(
25
25
  'blah blah blah', {}, '/',
26
26
  binary: false, mtime: Time.now - 500
27
27
  )
28
- rep = Nanoc::ItemRep.new(item, nil)
28
+ rep = Nanoc::Int::ItemRep.new(item, nil)
29
29
  rep.instance_eval { @content = { pre: 'pre content', last: 'last content' } }
30
30
  rep.expects(:compiled?).returns(true)
31
31
 
@@ -35,11 +35,11 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
35
35
 
36
36
  def test_compiled_content_with_custom_snapshot
37
37
  # Create rep
38
- item = Nanoc::Item.new(
38
+ item = Nanoc::Int::Item.new(
39
39
  'blah blah blah', {}, '/',
40
40
  binary: false, mtime: Time.now - 500
41
41
  )
42
- rep = Nanoc::ItemRep.new(item, nil)
42
+ rep = Nanoc::Int::ItemRep.new(item, nil)
43
43
  rep.instance_eval { @content = { pre: 'pre content', last: 'last content' } }
44
44
  rep.expects(:compiled?).returns(true)
45
45
 
@@ -49,57 +49,57 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
49
49
 
50
50
  def test_compiled_content_with_invalid_snapshot
51
51
  # Create rep
52
- item = Nanoc::Item.new(
52
+ item = Nanoc::Int::Item.new(
53
53
  'blah blah blah', {}, '/',
54
54
  binary: false, mtime: Time.now - 500
55
55
  )
56
- rep = Nanoc::ItemRep.new(item, nil)
56
+ rep = Nanoc::Int::ItemRep.new(item, nil)
57
57
  rep.instance_eval { @content = { pre: 'pre content', last: 'last content' } }
58
58
 
59
59
  # Check
60
- assert_raises Nanoc::Errors::NoSuchSnapshot do
60
+ assert_raises Nanoc::Int::Errors::NoSuchSnapshot do
61
61
  rep.compiled_content(snapshot: :klsjflkasdfl)
62
62
  end
63
63
  end
64
64
 
65
65
  def test_compiled_content_with_uncompiled_content
66
66
  # Create rep
67
- item = Nanoc::Item.new(
67
+ item = Nanoc::Int::Item.new(
68
68
  'blah blah', {}, '/',
69
69
  binary: false
70
70
  )
71
- rep = Nanoc::ItemRep.new(item, nil)
71
+ rep = Nanoc::Int::ItemRep.new(item, nil)
72
72
  rep.expects(:compiled?).returns(false)
73
73
 
74
74
  # Check
75
- assert_raises(Nanoc::Errors::UnmetDependency) do
75
+ assert_raises(Nanoc::Int::Errors::UnmetDependency) do
76
76
  rep.compiled_content
77
77
  end
78
78
  end
79
79
 
80
80
  def test_compiled_content_with_moving_pre_snapshot
81
81
  # Create rep
82
- item = Nanoc::Item.new(
82
+ item = Nanoc::Int::Item.new(
83
83
  'blah blah', {}, '/',
84
84
  binary: false
85
85
  )
86
- rep = Nanoc::ItemRep.new(item, nil)
86
+ rep = Nanoc::Int::ItemRep.new(item, nil)
87
87
  rep.expects(:compiled?).returns(false)
88
88
  rep.instance_eval { @content = { pre: 'pre!', last: 'last!' } }
89
89
 
90
90
  # Check
91
- assert_raises(Nanoc::Errors::UnmetDependency) do
91
+ assert_raises(Nanoc::Int::Errors::UnmetDependency) do
92
92
  rep.compiled_content(snapshot: :pre)
93
93
  end
94
94
  end
95
95
 
96
96
  def test_compiled_content_with_non_moving_pre_snapshot
97
97
  # Create rep
98
- item = Nanoc::Item.new(
98
+ item = Nanoc::Int::Item.new(
99
99
  'blah blah', {}, '/',
100
100
  binary: false
101
101
  )
102
- rep = Nanoc::ItemRep.new(item, nil)
102
+ rep = Nanoc::Int::ItemRep.new(item, nil)
103
103
  rep.expects(:compiled?).returns(false)
104
104
  rep.snapshots = [[:pre, true]]
105
105
  rep.instance_eval { @content = { pre: 'pre!', post: 'post!', last: 'last!' } }
@@ -110,13 +110,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
110
110
 
111
111
  def test_compiled_content_with_final_pre_snapshot_in_layout
112
112
  # Mock layout
113
- layout = Nanoc::Layout.new(
113
+ layout = Nanoc::Int::Layout.new(
114
114
  %(BEFORE <%= @item_rep.compiled_content(snapshot: :pre) %> AFTER),
115
115
  {},
116
116
  '/somelayout/')
117
117
 
118
118
  # Create item and item rep
119
- item = Nanoc::Item.new(
119
+ item = Nanoc::Int::Item.new(
120
120
  'blah blah', {}, '/',
121
121
  binary: false
122
122
  )
@@ -136,13 +136,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
136
136
  site.expect(:layouts, [])
137
137
 
138
138
  # Mock item
139
- item = Nanoc::Item.new(
139
+ item = Nanoc::Int::Item.new(
140
140
  %(<%= '<%= "blah" %' + '>' %>), {}, '/',
141
141
  binary: false
142
142
  )
143
143
 
144
144
  # Create item rep
145
- item_rep = Nanoc::ItemRep.new(item, :foo)
145
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
146
146
  item_rep.instance_eval do
147
147
  @content[:raw] = item.raw_content
148
148
  @content[:last] = @content[:raw]
@@ -161,16 +161,16 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
161
161
 
162
162
  def test_layout
163
163
  # Mock layout
164
- layout = Nanoc::Layout.new(%(<%= "blah" %>), {}, '/somelayout/')
164
+ layout = Nanoc::Int::Layout.new(%(<%= "blah" %>), {}, '/somelayout/')
165
165
 
166
166
  # Mock item
167
- item = Nanoc::Item.new(
167
+ item = Nanoc::Int::Item.new(
168
168
  'blah blah', {}, '/',
169
169
  binary: false
170
170
  )
171
171
 
172
172
  # Create item rep
173
- item_rep = Nanoc::ItemRep.new(item, :foo)
173
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
174
174
  item_rep.instance_eval do
175
175
  @content[:raw] = item.raw_content
176
176
  @content[:last] = @content[:raw]
@@ -190,13 +190,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
190
190
  site.expect(:layouts, [])
191
191
 
192
192
  # Mock item
193
- item = Nanoc::Item.new(
193
+ item = Nanoc::Int::Item.new(
194
194
  %(<%= '<%= "blah" %' + '>' %>), {}, '/foobar/',
195
195
  binary: false
196
196
  )
197
197
 
198
198
  # Create item rep
199
- item_rep = Nanoc::ItemRep.new(item, :foo)
199
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
200
200
  item_rep.instance_eval do
201
201
  @content[:raw] = item.raw_content
202
202
  @content[:last] = @content[:raw]
@@ -218,13 +218,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
218
218
 
219
219
  def test_snapshot_should_be_written
220
220
  # Mock item
221
- item = Nanoc::Item.new(
221
+ item = Nanoc::Int::Item.new(
222
222
  'blah blah', {}, '/',
223
223
  binary: false
224
224
  )
225
225
 
226
226
  # Create rep
227
- item_rep = Nanoc::ItemRep.new(item, :foo)
227
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
228
228
  item_rep.instance_eval { @content[:last] = 'Lorem ipsum, etc.' }
229
229
  item_rep.raw_paths = { moo: 'foo-moo.txt' }
230
230
 
@@ -247,16 +247,16 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
247
247
 
248
248
  def test_write_should_not_touch_identical_textual_files
249
249
  # Mock item
250
- item = Nanoc::Item.new(
250
+ item = Nanoc::Int::Item.new(
251
251
  'blah blah', {}, '/',
252
252
  binary: false
253
253
  )
254
254
 
255
255
  # Create rep
256
- item_rep = Nanoc::ItemRep.new(item, :foo)
256
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
257
257
  def item_rep.generate_diff; end
258
258
  item_rep.instance_eval { @content[:last] = 'Lorem ipsum, etc.' }
259
- item_rep.raw_path = 'foo/bar/baz/quux.txt'
259
+ item_rep.raw_paths[:last] = 'foo/bar/baz/quux.txt'
260
260
 
261
261
  # Write once
262
262
  item_rep.write
@@ -271,15 +271,15 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
271
271
 
272
272
  def test_write
273
273
  # Mock item
274
- item = Nanoc::Item.new(
274
+ item = Nanoc::Int::Item.new(
275
275
  'blah blah', {}, '/',
276
276
  binary: false
277
277
  )
278
278
 
279
279
  # Create rep
280
- item_rep = Nanoc::ItemRep.new(item, :foo)
280
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
281
281
  item_rep.instance_eval { @content[:last] = 'Lorem ipsum, etc.' }
282
- item_rep.raw_path = 'foo/bar/baz/quux.txt'
282
+ item_rep.raw_paths[:last] = 'foo/bar/baz/quux.txt'
283
283
 
284
284
  # Write
285
285
  item_rep.write
@@ -291,13 +291,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
291
291
 
292
292
  def test_filter_text_to_binary
293
293
  # Mock item
294
- item = Nanoc::Item.new(
294
+ item = Nanoc::Int::Item.new(
295
295
  'blah blah', {}, '/',
296
296
  binary: false
297
297
  )
298
298
 
299
299
  # Create rep
300
- rep = Nanoc::ItemRep.new(item, :foo)
300
+ rep = Nanoc::Int::ItemRep.new(item, :foo)
301
301
  def rep.assigns
302
302
  {}
303
303
  end
@@ -321,13 +321,13 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
321
321
 
322
322
  def test_filter_with_textual_rep_and_binary_filter
323
323
  # Mock item
324
- item = Nanoc::Item.new(
324
+ item = Nanoc::Int::Item.new(
325
325
  'blah blah', {}, '/',
326
326
  binary: false
327
327
  )
328
328
 
329
329
  # Create rep
330
- rep = Nanoc::ItemRep.new(item, :foo)
330
+ rep = Nanoc::Int::ItemRep.new(item, :foo)
331
331
  def rep.assigns
332
332
  {}
333
333
  end
@@ -343,7 +343,7 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
343
343
  end
344
344
 
345
345
  # Run
346
- assert_raises ::Nanoc::Errors::CannotUseBinaryFilter do
346
+ assert_raises ::Nanoc::Int::Errors::CannotUseBinaryFilter do
347
347
  rep.filter(:foo)
348
348
  end
349
349
  end
@@ -359,7 +359,7 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
359
359
  create_textual_filter
360
360
 
361
361
  assert rep.binary?
362
- assert_raises(Nanoc::Errors::CannotUseTextualFilter) { rep.filter(:text_filter) }
362
+ assert_raises(Nanoc::Int::Errors::CannotUseTextualFilter) { rep.filter(:text_filter) }
363
363
  end
364
364
 
365
365
  def test_writing_binary_reps_uses_content_in_last_filename
@@ -383,7 +383,7 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
383
383
 
384
384
  def test_converted_binary_rep_can_be_layed_out
385
385
  # Mock layout
386
- layout = Nanoc::Layout.new(%(<%= "blah" %> <%= yield %>), {}, '/somelayout/')
386
+ layout = Nanoc::Int::Layout.new(%(<%= "blah" %> <%= yield %>), {}, '/somelayout/')
387
387
 
388
388
  # Create item and item rep
389
389
  item = create_binary_item
@@ -464,7 +464,7 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
464
464
  end
465
465
  rep.filter(:binary_to_text)
466
466
  refute rep.binary?
467
- assert_raises(Nanoc::Errors::CannotUseBinaryFilter) { rep.filter(:binary_filter) }
467
+ assert_raises(Nanoc::Int::Errors::CannotUseBinaryFilter) { rep.filter(:binary_filter) }
468
468
  end
469
469
 
470
470
  def test_new_content_should_be_frozen
@@ -475,8 +475,8 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
475
475
  end
476
476
  end
477
477
 
478
- item = Nanoc::Item.new('foo bar', {}, '/foo/')
479
- rep = Nanoc::ItemRep.new(item, :default)
478
+ item = Nanoc::Int::Item.new('foo bar', {}, '/foo/')
479
+ rep = Nanoc::Int::ItemRep.new(item, :default)
480
480
  rep.instance_eval { @filter_class = filter_class }
481
481
  def rep.filter_named(_name)
482
482
  @filter_class
@@ -495,8 +495,8 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
495
495
  end
496
496
  end
497
497
 
498
- item = Nanoc::Item.new('foo bar', {}, '/foo/')
499
- rep = Nanoc::ItemRep.new(item, :default)
498
+ item = Nanoc::Int::Item.new('foo bar', {}, '/foo/')
499
+ rep = Nanoc::Int::ItemRep.new(item, :default)
500
500
  rep.instance_eval { @filter_class = filter_class }
501
501
  def rep.filter_named(_name)
502
502
  @filter_class
@@ -510,19 +510,19 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
510
510
 
511
511
  def test_raw_path_should_generate_dependency
512
512
  items = [
513
- Nanoc3::Item.new('foo', {}, '/foo/'),
514
- Nanoc3::Item.new('bar', {}, '/bar/')
513
+ Nanoc::Int::Item.new('foo', {}, '/foo/'),
514
+ Nanoc::Int::Item.new('bar', {}, '/bar/')
515
515
  ]
516
516
  item_reps = [
517
- Nanoc3::ItemRep.new(items[0], :default),
518
- Nanoc3::ItemRep.new(items[1], :default)
517
+ Nanoc::Int::ItemRep.new(items[0], :default),
518
+ Nanoc::Int::ItemRep.new(items[1], :default)
519
519
  ]
520
520
 
521
- dt = Nanoc3::DependencyTracker.new(items)
521
+ dt = Nanoc::Int::DependencyTracker.new(items)
522
522
  dt.start
523
- Nanoc3::NotificationCenter.post(:visit_started, items[0])
523
+ Nanoc::Int::NotificationCenter.post(:visit_started, items[0])
524
524
  item_reps[1].raw_path
525
- Nanoc3::NotificationCenter.post(:visit_ended, items[0])
525
+ Nanoc::Int::NotificationCenter.post(:visit_ended, items[0])
526
526
  dt.stop
527
527
 
528
528
  assert_equal [items[1]], dt.objects_causing_outdatedness_of(items[0])
@@ -530,28 +530,28 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
530
530
 
531
531
  def test_path_should_generate_dependency
532
532
  items = [
533
- Nanoc3::Item.new('foo', {}, '/foo/'),
534
- Nanoc3::Item.new('bar', {}, '/bar/')
533
+ Nanoc::Int::Item.new('foo', {}, '/foo/'),
534
+ Nanoc::Int::Item.new('bar', {}, '/bar/')
535
535
  ]
536
536
  item_reps = [
537
- Nanoc3::ItemRep.new(items[0], :default),
538
- Nanoc3::ItemRep.new(items[1], :default)
537
+ Nanoc::Int::ItemRep.new(items[0], :default),
538
+ Nanoc::Int::ItemRep.new(items[1], :default)
539
539
  ]
540
540
 
541
- dt = Nanoc3::DependencyTracker.new(items)
541
+ dt = Nanoc::Int::DependencyTracker.new(items)
542
542
  dt.start
543
- Nanoc3::NotificationCenter.post(:visit_started, items[0])
543
+ Nanoc::Int::NotificationCenter.post(:visit_started, items[0])
544
544
  item_reps[1].path
545
- Nanoc3::NotificationCenter.post(:visit_ended, items[0])
545
+ Nanoc::Int::NotificationCenter.post(:visit_ended, items[0])
546
546
  dt.stop
547
547
 
548
548
  assert_equal [items[1]], dt.objects_causing_outdatedness_of(items[0])
549
549
  end
550
550
 
551
551
  def test_access_compiled_content_of_binary_item
552
- item = Nanoc::Item.new('content/somefile.dat', {}, '/somefile/', binary: true)
553
- item_rep = Nanoc::ItemRep.new(item, :foo)
554
- assert_raises(Nanoc::Errors::CannotGetCompiledContentOfBinaryItem) do
552
+ item = Nanoc::Int::Item.new('content/somefile.dat', {}, '/somefile/', binary: true)
553
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
554
+ assert_raises(Nanoc::Int::Errors::CannotGetCompiledContentOfBinaryItem) do
555
555
  item_rep.compiled_content
556
556
  end
557
557
  end
@@ -560,64 +560,64 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
560
560
  # Mock item
561
561
  FileUtils.mkdir_p('content')
562
562
  File.open('content/meow.dat', 'w') { |io| io.write('asdf') }
563
- item = Nanoc::Item.new(
563
+ item = Nanoc::Int::Item.new(
564
564
  'content/meow.dat', {}, '/',
565
565
  binary: true
566
566
  )
567
567
 
568
568
  # Create rep
569
- item_rep = Nanoc::ItemRep.new(item, :foo)
569
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
570
570
  FileUtils.mkdir_p('tmp')
571
571
  File.open('tmp/woof.dat', 'w') { |io| io.write('fdsa') }
572
572
  item_rep.instance_eval { @temporary_filenames[:last] = 'tmp/woof.dat' }
573
- item_rep.raw_path = 'output/woof.dat'
573
+ item_rep.raw_paths[:last] = 'output/woof.dat'
574
574
 
575
575
  # Write
576
576
  notified = false
577
- Nanoc::NotificationCenter.on(:rep_written, self) do |_rep, _raw_path, is_created, is_modified|
577
+ Nanoc::Int::NotificationCenter.on(:rep_written, self) do |_rep, _raw_path, is_created, is_modified|
578
578
  notified = true
579
579
  assert is_created
580
580
  assert is_modified
581
581
  end
582
582
  item_rep.write
583
583
  assert notified
584
- Nanoc::NotificationCenter.remove(:rep_written, self)
584
+ Nanoc::Int::NotificationCenter.remove(:rep_written, self)
585
585
  end
586
586
 
587
587
  def test_write_should_calculate_is_modified_correctly_for_binary_items_existing
588
588
  # Mock item
589
589
  FileUtils.mkdir_p('content')
590
590
  File.open('content/meow.dat', 'w') { |io| io.write('asdf') }
591
- item = Nanoc::Item.new(
591
+ item = Nanoc::Int::Item.new(
592
592
  'content/meow.dat', {}, '/',
593
593
  binary: true
594
594
  )
595
595
 
596
596
  # Create rep
597
- item_rep = Nanoc::ItemRep.new(item, :foo)
597
+ item_rep = Nanoc::Int::ItemRep.new(item, :foo)
598
598
  FileUtils.mkdir_p('tmp')
599
599
  File.open('tmp/woof.dat', 'w') { |io| io.write('fdsa') }
600
600
  FileUtils.mkdir_p('output')
601
601
  File.open('output/woof.dat', 'w') { |io| io.write('fdsa but different') }
602
602
  item_rep.instance_eval { @temporary_filenames[:last] = 'tmp/woof.dat' }
603
- item_rep.raw_path = 'output/woof.dat'
603
+ item_rep.raw_paths[:last] = 'output/woof.dat'
604
604
 
605
605
  # Write
606
606
  notified = false
607
- Nanoc::NotificationCenter.on(:rep_written, self) do |_rep, _raw_path, is_created, is_modified|
607
+ Nanoc::Int::NotificationCenter.on(:rep_written, self) do |_rep, _raw_path, is_created, is_modified|
608
608
  notified = true
609
609
  refute is_created
610
610
  assert is_modified
611
611
  end
612
612
  item_rep.write
613
613
  assert notified
614
- Nanoc::NotificationCenter.remove(:rep_written, self)
614
+ Nanoc::Int::NotificationCenter.remove(:rep_written, self)
615
615
  end
616
616
 
617
617
  private
618
618
 
619
619
  def create_binary_item
620
- Nanoc::Item.new(
620
+ Nanoc::Int::Item.new(
621
621
  '/a/file/name.dat', {}, '/',
622
622
  binary: true
623
623
  )
@@ -632,7 +632,7 @@ class Nanoc::ItemRepTest < Nanoc::TestCase
632
632
  end
633
633
 
634
634
  def create_rep_for(item, name)
635
- Nanoc::ItemRep.new(item, name)
635
+ Nanoc::Int::ItemRep.new(item, name)
636
636
  end
637
637
 
638
638
  def create_textual_filter