nanoc 4.0.0b2 → 4.0.0b3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -22
- data/NEWS.md +20 -0
- data/Rakefile +0 -2
- data/bin/nanoc +0 -2
- data/lib/nanoc.rb +0 -2
- data/lib/nanoc/base.rb +1 -2
- data/lib/nanoc/base/checksummer.rb +0 -2
- data/lib/nanoc/base/compilation/checksum_store.rb +0 -2
- data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -2
- data/lib/nanoc/base/compilation/compiler.rb +0 -2
- data/lib/nanoc/base/compilation/compiler_dsl.rb +0 -2
- data/lib/nanoc/base/compilation/dependency_tracker.rb +0 -2
- data/lib/nanoc/base/compilation/filter.rb +0 -2
- data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -2
- data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -2
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -2
- data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -2
- data/lib/nanoc/base/compilation/rule.rb +0 -2
- data/lib/nanoc/base/compilation/rule_context.rb +0 -2
- data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -2
- data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -2
- data/lib/nanoc/base/compilation/rules_collection.rb +0 -2
- data/lib/nanoc/base/context.rb +0 -2
- data/lib/nanoc/base/core_ext.rb +0 -2
- data/lib/nanoc/base/core_ext/array.rb +0 -2
- data/lib/nanoc/base/core_ext/hash.rb +0 -2
- data/lib/nanoc/base/core_ext/pathname.rb +0 -2
- data/lib/nanoc/base/core_ext/string.rb +0 -2
- data/lib/nanoc/base/directed_graph.rb +0 -2
- data/lib/nanoc/base/error.rb +0 -2
- data/lib/nanoc/base/errors.rb +0 -2
- data/lib/nanoc/base/identifiable_collection.rb +0 -2
- data/lib/nanoc/base/memoization.rb +0 -2
- data/lib/nanoc/base/notification_center.rb +0 -2
- data/lib/nanoc/base/pattern.rb +0 -2
- data/lib/nanoc/base/plugin_registry.rb +0 -2
- data/lib/nanoc/base/result_data/item_rep.rb +0 -2
- data/lib/nanoc/base/source_data/code_snippet.rb +0 -2
- data/lib/nanoc/base/source_data/configuration.rb +0 -2
- data/lib/nanoc/base/source_data/data_source.rb +0 -2
- data/lib/nanoc/base/source_data/identifier.rb +0 -2
- data/lib/nanoc/base/source_data/item.rb +0 -2
- data/lib/nanoc/base/source_data/layout.rb +0 -2
- data/lib/nanoc/base/source_data/site.rb +1 -3
- data/lib/nanoc/base/store.rb +0 -2
- data/lib/nanoc/base/temp_filename_factory.rb +0 -2
- data/lib/nanoc/base/views/config.rb +0 -2
- data/lib/nanoc/base/views/identifiable_collection.rb +0 -2
- data/lib/nanoc/base/views/item.rb +3 -5
- data/lib/nanoc/base/views/item_collection.rb +0 -2
- data/lib/nanoc/base/views/item_rep.rb +0 -2
- data/lib/nanoc/base/views/item_rep_collection.rb +48 -0
- data/lib/nanoc/base/views/layout.rb +0 -2
- data/lib/nanoc/base/views/layout_collection.rb +0 -2
- data/lib/nanoc/base/views/mutable_config.rb +0 -2
- data/lib/nanoc/base/views/mutable_identifiable_collection.rb +0 -2
- data/lib/nanoc/base/views/mutable_item.rb +0 -2
- data/lib/nanoc/base/views/mutable_item_collection.rb +0 -2
- data/lib/nanoc/base/views/mutable_layout.rb +0 -2
- data/lib/nanoc/base/views/mutable_layout_collection.rb +0 -2
- data/lib/nanoc/base/views/site.rb +0 -2
- data/lib/nanoc/cli.rb +0 -2
- data/lib/nanoc/cli/ansi_string_colorizer.rb +0 -2
- data/lib/nanoc/cli/cleaning_stream.rb +0 -2
- data/lib/nanoc/cli/command_runner.rb +0 -2
- data/lib/nanoc/cli/commands/check.rb +0 -2
- data/lib/nanoc/cli/commands/compile.rb +0 -2
- data/lib/nanoc/cli/commands/create-site.rb +7 -25
- data/lib/nanoc/cli/commands/deploy.rb +0 -2
- data/lib/nanoc/cli/commands/nanoc.rb +0 -2
- data/lib/nanoc/cli/commands/prune.rb +0 -2
- data/lib/nanoc/cli/commands/shell.rb +0 -2
- data/lib/nanoc/cli/commands/show-data.rb +0 -2
- data/lib/nanoc/cli/commands/show-plugins.rb +0 -2
- data/lib/nanoc/cli/commands/show-rules.rb +0 -2
- data/lib/nanoc/cli/commands/view.rb +0 -2
- data/lib/nanoc/cli/error_handler.rb +0 -2
- data/lib/nanoc/cli/logger.rb +0 -2
- data/lib/nanoc/cli/stream_cleaners.rb +0 -2
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +0 -2
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -2
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +0 -2
- data/lib/nanoc/data_sources.rb +1 -5
- data/lib/nanoc/data_sources/filesystem.rb +2 -2
- data/lib/nanoc/data_sources/filesystem_unified.rb +0 -2
- data/lib/nanoc/extra.rb +0 -2
- data/lib/nanoc/extra/checking.rb +0 -2
- data/lib/nanoc/extra/checking/check.rb +23 -15
- data/lib/nanoc/extra/checking/checks.rb +0 -2
- data/lib/nanoc/extra/checking/checks/css.rb +1 -3
- data/lib/nanoc/extra/checking/checks/external_links.rb +0 -2
- data/lib/nanoc/extra/checking/checks/html.rb +1 -3
- data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -5
- data/lib/nanoc/extra/checking/checks/mixed_content.rb +0 -2
- data/lib/nanoc/extra/checking/checks/stale.rb +2 -4
- data/lib/nanoc/extra/checking/dsl.rb +0 -2
- data/lib/nanoc/extra/checking/issue.rb +0 -2
- data/lib/nanoc/extra/checking/runner.rb +1 -3
- data/lib/nanoc/extra/core_ext.rb +0 -2
- data/lib/nanoc/extra/core_ext/pathname.rb +0 -2
- data/lib/nanoc/extra/core_ext/time.rb +0 -2
- data/lib/nanoc/extra/deployer.rb +0 -2
- data/lib/nanoc/extra/deployers.rb +0 -2
- data/lib/nanoc/extra/deployers/fog.rb +40 -8
- data/lib/nanoc/extra/deployers/rsync.rb +0 -2
- data/lib/nanoc/extra/filesystem_tools.rb +0 -2
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -2
- data/lib/nanoc/extra/link_collector.rb +0 -2
- data/lib/nanoc/extra/piper.rb +0 -2
- data/lib/nanoc/extra/pruner.rb +0 -2
- data/lib/nanoc/filters.rb +0 -2
- data/lib/nanoc/filters/asciidoc.rb +0 -2
- data/lib/nanoc/filters/bluecloth.rb +0 -2
- data/lib/nanoc/filters/coffeescript.rb +0 -2
- data/lib/nanoc/filters/colorize_syntax.rb +0 -2
- data/lib/nanoc/filters/erb.rb +0 -2
- data/lib/nanoc/filters/erubis.rb +0 -2
- data/lib/nanoc/filters/haml.rb +0 -2
- data/lib/nanoc/filters/handlebars.rb +0 -2
- data/lib/nanoc/filters/kramdown.rb +0 -2
- data/lib/nanoc/filters/less.rb +0 -2
- data/lib/nanoc/filters/markaby.rb +0 -2
- data/lib/nanoc/filters/maruku.rb +0 -2
- data/lib/nanoc/filters/mustache.rb +0 -2
- data/lib/nanoc/filters/pandoc.rb +0 -2
- data/lib/nanoc/filters/rainpress.rb +0 -2
- data/lib/nanoc/filters/rdiscount.rb +0 -2
- data/lib/nanoc/filters/rdoc.rb +0 -2
- data/lib/nanoc/filters/redcarpet.rb +0 -2
- data/lib/nanoc/filters/redcloth.rb +0 -2
- data/lib/nanoc/filters/relativize_paths.rb +0 -2
- data/lib/nanoc/filters/rubypants.rb +0 -2
- data/lib/nanoc/filters/sass.rb +0 -2
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
- data/lib/nanoc/filters/slim.rb +0 -2
- data/lib/nanoc/filters/typogruby.rb +0 -2
- data/lib/nanoc/filters/uglify_js.rb +0 -2
- data/lib/nanoc/filters/xsl.rb +0 -2
- data/lib/nanoc/filters/yui_compressor.rb +0 -2
- data/lib/nanoc/helpers.rb +0 -2
- data/lib/nanoc/helpers/blogging.rb +0 -2
- data/lib/nanoc/helpers/breadcrumbs.rb +0 -2
- data/lib/nanoc/helpers/capturing.rb +0 -2
- data/lib/nanoc/helpers/filtering.rb +0 -2
- data/lib/nanoc/helpers/html_escape.rb +0 -2
- data/lib/nanoc/helpers/link_to.rb +0 -2
- data/lib/nanoc/helpers/rendering.rb +0 -2
- data/lib/nanoc/helpers/tagging.rb +0 -2
- data/lib/nanoc/helpers/text.rb +0 -2
- data/lib/nanoc/helpers/xml_sitemap.rb +0 -2
- data/lib/nanoc/version.rb +1 -3
- data/nanoc.gemspec +1 -3
- data/tasks/doc.rake +0 -2
- data/tasks/test.rake +0 -2
- data/test/base/checksummer_spec.rb +0 -2
- data/test/base/core_ext/array_spec.rb +0 -2
- data/test/base/core_ext/hash_spec.rb +0 -2
- data/test/base/core_ext/pathname_spec.rb +0 -2
- data/test/base/core_ext/string_spec.rb +0 -2
- data/test/base/temp_filename_factory_spec.rb +0 -2
- data/test/base/test_checksum_store.rb +0 -2
- data/test/base/test_code_snippet.rb +0 -2
- data/test/base/test_compiler.rb +0 -2
- data/test/base/test_compiler_dsl.rb +1 -3
- data/test/base/test_context.rb +0 -2
- data/test/base/test_data_source.rb +0 -2
- data/test/base/test_dependency_tracker.rb +0 -2
- data/test/base/test_directed_graph.rb +0 -2
- data/test/base/test_filter.rb +0 -2
- data/test/base/test_item.rb +0 -2
- data/test/base/test_item_array.rb +0 -2
- data/test/base/test_item_rep.rb +0 -2
- data/test/base/test_item_rep_recorder_proxy.rb +0 -2
- data/test/base/test_layout.rb +0 -2
- data/test/base/test_memoization.rb +0 -2
- data/test/base/test_notification_center.rb +0 -2
- data/test/base/test_outdatedness_checker.rb +1 -3
- data/test/base/test_plugin.rb +0 -2
- data/test/base/test_rule.rb +0 -2
- data/test/base/test_rule_context.rb +0 -2
- data/test/base/test_site.rb +1 -3
- data/test/base/test_store.rb +0 -2
- data/test/cli/commands/test_check.rb +0 -2
- data/test/cli/commands/test_compile.rb +0 -2
- data/test/cli/commands/test_create_site.rb +1 -3
- data/test/cli/commands/test_deploy.rb +0 -2
- data/test/cli/commands/test_help.rb +0 -2
- data/test/cli/commands/test_info.rb +0 -2
- data/test/cli/commands/test_prune.rb +2 -4
- data/test/cli/test_cleaning_stream.rb +0 -2
- data/test/cli/test_cli.rb +0 -6
- data/test/cli/test_error_handler.rb +0 -2
- data/test/cli/test_logger.rb +0 -2
- data/test/data_sources/test_filesystem.rb +0 -2
- data/test/data_sources/test_filesystem_unified.rb +15 -2
- data/test/extra/checking/checks/test_css.rb +3 -5
- data/test/extra/checking/checks/test_external_links.rb +5 -7
- data/test/extra/checking/checks/test_html.rb +2 -4
- data/test/extra/checking/checks/test_internal_links.rb +5 -7
- data/test/extra/checking/checks/test_mixed_content.rb +8 -10
- data/test/extra/checking/checks/test_stale.rb +1 -3
- data/test/extra/checking/test_check.rb +2 -6
- data/test/extra/checking/test_dsl.rb +0 -2
- data/test/extra/checking/test_runner.rb +0 -2
- data/test/extra/core_ext/test_pathname.rb +0 -2
- data/test/extra/core_ext/test_time.rb +0 -2
- data/test/extra/deployers/test_fog.rb +147 -2
- data/test/extra/deployers/test_rsync.rb +0 -2
- data/test/extra/test_filesystem_tools.rb +0 -2
- data/test/extra/test_link_collector.rb +0 -2
- data/test/extra/test_piper.rb +0 -2
- data/test/filters/test_asciidoc.rb +0 -2
- data/test/filters/test_bluecloth.rb +0 -2
- data/test/filters/test_coffeescript.rb +0 -2
- data/test/filters/test_colorize_syntax.rb +0 -2
- data/test/filters/test_erb.rb +0 -2
- data/test/filters/test_erubis.rb +0 -2
- data/test/filters/test_haml.rb +0 -2
- data/test/filters/test_handlebars.rb +0 -2
- data/test/filters/test_kramdown.rb +0 -2
- data/test/filters/test_less.rb +0 -2
- data/test/filters/test_markaby.rb +0 -2
- data/test/filters/test_maruku.rb +0 -2
- data/test/filters/test_mustache.rb +0 -2
- data/test/filters/test_pandoc.rb +0 -2
- data/test/filters/test_rainpress.rb +0 -2
- data/test/filters/test_rdiscount.rb +0 -2
- data/test/filters/test_rdoc.rb +0 -2
- data/test/filters/test_redcarpet.rb +0 -2
- data/test/filters/test_redcloth.rb +0 -2
- data/test/filters/test_relativize_paths.rb +0 -2
- data/test/filters/test_rubypants.rb +0 -2
- data/test/filters/test_sass.rb +0 -2
- data/test/filters/test_slim.rb +0 -2
- data/test/filters/test_typogruby.rb +0 -2
- data/test/filters/test_uglify_js.rb +0 -2
- data/test/filters/test_xsl.rb +0 -2
- data/test/filters/test_yui_compressor.rb +0 -2
- data/test/gem_loader.rb +0 -2
- data/test/helper.rb +1 -3
- data/test/helpers/test_blogging.rb +0 -2
- data/test/helpers/test_breadcrumbs.rb +0 -2
- data/test/helpers/test_capturing.rb +0 -2
- data/test/helpers/test_filtering.rb +0 -2
- data/test/helpers/test_html_escape.rb +0 -2
- data/test/helpers/test_link_to.rb +0 -2
- data/test/helpers/test_rendering.rb +0 -2
- data/test/helpers/test_tagging.rb +0 -2
- data/test/helpers/test_text.rb +0 -2
- data/test/helpers/test_xml_sitemap.rb +0 -2
- data/test/test_gem.rb +0 -5
- metadata +5 -6
- data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -71
- data/test/data_sources/test_filesystem_verbose.rb +0 -308
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
4
2
|
def test_run
|
5
3
|
if_have 'fog' do
|
@@ -128,4 +126,151 @@ class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
128
126
|
assert_equal 'I am a dog!', File.read('mylocalcloud/mybucket/bark')
|
129
127
|
end
|
130
128
|
end
|
129
|
+
|
130
|
+
def test_upload
|
131
|
+
if_have 'fog' do
|
132
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
133
|
+
'output/', provider: 'aws')
|
134
|
+
|
135
|
+
key_old = '__old'
|
136
|
+
key_same = '__same'
|
137
|
+
key_new = '__new'
|
138
|
+
|
139
|
+
File.write(key_same, 'hallo')
|
140
|
+
File.write(key_new, 'hallo new')
|
141
|
+
|
142
|
+
etags = {
|
143
|
+
key_same => '598d4c200461b81522a3328565c25f7c',
|
144
|
+
key_new => '598d4c200461b81522a3328565c25f7c',
|
145
|
+
}
|
146
|
+
|
147
|
+
keys_to_destroy = [key_old, key_same, key_new]
|
148
|
+
keys_to_invalidate = []
|
149
|
+
|
150
|
+
s3_files = mock
|
151
|
+
s3_files.stubs(:create)
|
152
|
+
s3_directory = mock
|
153
|
+
s3_directory.stubs(:files).returns(s3_files)
|
154
|
+
|
155
|
+
# key_same
|
156
|
+
refute fog.send(:needs_upload?, key_same, key_same, etags)
|
157
|
+
fog.send(
|
158
|
+
:upload, key_same, key_same, etags, keys_to_destroy, keys_to_invalidate, s3_directory)
|
159
|
+
|
160
|
+
assert_equal([key_old, key_new], keys_to_destroy)
|
161
|
+
assert_equal([], keys_to_invalidate)
|
162
|
+
|
163
|
+
# key_new
|
164
|
+
assert fog.send(:needs_upload?, key_new, key_new, etags)
|
165
|
+
fog.send(
|
166
|
+
:upload, key_new, key_new, etags, keys_to_destroy, keys_to_invalidate, s3_directory)
|
167
|
+
|
168
|
+
assert_equal([key_old], keys_to_destroy)
|
169
|
+
assert_equal([key_new], keys_to_invalidate)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def test_read_etags_with_local_provider
|
174
|
+
if_have 'fog' do
|
175
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
176
|
+
'output/', provider: 'local')
|
177
|
+
|
178
|
+
files = [
|
179
|
+
mock('file_a'),
|
180
|
+
mock('file_b'),
|
181
|
+
]
|
182
|
+
|
183
|
+
assert_equal({}, fog.send(:read_etags, files))
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def test_read_etags_with_aws_provider
|
188
|
+
if_have 'fog' do
|
189
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
190
|
+
'output/', provider: 'aws')
|
191
|
+
|
192
|
+
files = [
|
193
|
+
mock('file_a', key: 'key_a', etag: 'etag_a'),
|
194
|
+
mock('file_b', key: 'key_b', etag: 'etag_b'),
|
195
|
+
]
|
196
|
+
|
197
|
+
expected = {
|
198
|
+
'key_a' => 'etag_a',
|
199
|
+
'key_b' => 'etag_b',
|
200
|
+
}
|
201
|
+
|
202
|
+
assert_equal(expected, fog.send(:read_etags, files))
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def test_calc_local_etag_with_local_provider
|
207
|
+
if_have 'fog' do
|
208
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
209
|
+
'output/', provider: 'local')
|
210
|
+
|
211
|
+
file_path = 'blah.tmp'
|
212
|
+
File.write(file_path, 'hallo')
|
213
|
+
|
214
|
+
assert_nil fog.send(:calc_local_etag, file_path)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_calc_local_etag_with_aws_provider
|
219
|
+
if_have 'fog' do
|
220
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
221
|
+
'output/', provider: 'aws')
|
222
|
+
|
223
|
+
file_path = 'blah.tmp'
|
224
|
+
File.write(file_path, 'hallo')
|
225
|
+
|
226
|
+
assert_equal(
|
227
|
+
'598d4c200461b81522a3328565c25f7c',
|
228
|
+
fog.send(:calc_local_etag, file_path))
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
def test_needs_upload_with_missing_remote_etag
|
233
|
+
if_have 'fog' do
|
234
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
235
|
+
'output/', provider: 'aws')
|
236
|
+
|
237
|
+
file_path = 'blah.tmp'
|
238
|
+
File.write(file_path, 'hallo')
|
239
|
+
|
240
|
+
key = 'some_key'
|
241
|
+
etags = {}
|
242
|
+
|
243
|
+
assert fog.send(:needs_upload?, key, file_path, etags)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_needs_upload_with_different_etags
|
248
|
+
if_have 'fog' do
|
249
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
250
|
+
'output/', provider: 'aws')
|
251
|
+
|
252
|
+
file_path = 'blah.tmp'
|
253
|
+
File.write(file_path, 'hallo')
|
254
|
+
|
255
|
+
key = 'some_key'
|
256
|
+
etags = { key => 'some_etag' }
|
257
|
+
|
258
|
+
assert fog.send(:needs_upload?, key, file_path, etags)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_needs_upload_with_identical_etags
|
263
|
+
if_have 'fog' do
|
264
|
+
fog = Nanoc::Extra::Deployers::Fog.new(
|
265
|
+
'output/', provider: 'aws')
|
266
|
+
|
267
|
+
file_path = 'blah.tmp'
|
268
|
+
File.write(file_path, 'hallo')
|
269
|
+
|
270
|
+
key = 'some_key'
|
271
|
+
etags = { key => '598d4c200461b81522a3328565c25f7c' }
|
272
|
+
|
273
|
+
refute fog.send(:needs_upload?, key, file_path, etags)
|
274
|
+
end
|
275
|
+
end
|
131
276
|
end
|
data/test/extra/test_piper.rb
CHANGED
data/test/filters/test_erb.rb
CHANGED
data/test/filters/test_erubis.rb
CHANGED
data/test/filters/test_haml.rb
CHANGED
data/test/filters/test_less.rb
CHANGED
data/test/filters/test_maruku.rb
CHANGED
data/test/filters/test_pandoc.rb
CHANGED
data/test/filters/test_rdoc.rb
CHANGED
data/test/filters/test_sass.rb
CHANGED
data/test/filters/test_slim.rb
CHANGED
data/test/filters/test_xsl.rb
CHANGED
data/test/gem_loader.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
# Set up gem loading (necessary for cri dependency)
|
4
2
|
require File.dirname(__FILE__) + '/gem_loader.rb'
|
5
3
|
|
@@ -107,7 +105,7 @@ EOS
|
|
107
105
|
io << 'string_pattern_type: legacy' << "\n"
|
108
106
|
io << 'data_sources:' << "\n"
|
109
107
|
io << ' -' << "\n"
|
110
|
-
io << ' type:
|
108
|
+
io << ' type: filesystem' << "\n"
|
111
109
|
io << ' identifier_type: legacy' << "\n"
|
112
110
|
end
|
113
111
|
|