nanoc 4.0.0b2 → 4.0.0b3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -22
  3. data/NEWS.md +20 -0
  4. data/Rakefile +0 -2
  5. data/bin/nanoc +0 -2
  6. data/lib/nanoc.rb +0 -2
  7. data/lib/nanoc/base.rb +1 -2
  8. data/lib/nanoc/base/checksummer.rb +0 -2
  9. data/lib/nanoc/base/compilation/checksum_store.rb +0 -2
  10. data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -2
  11. data/lib/nanoc/base/compilation/compiler.rb +0 -2
  12. data/lib/nanoc/base/compilation/compiler_dsl.rb +0 -2
  13. data/lib/nanoc/base/compilation/dependency_tracker.rb +0 -2
  14. data/lib/nanoc/base/compilation/filter.rb +0 -2
  15. data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -2
  16. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -2
  17. data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -2
  18. data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -2
  19. data/lib/nanoc/base/compilation/rule.rb +0 -2
  20. data/lib/nanoc/base/compilation/rule_context.rb +0 -2
  21. data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -2
  22. data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -2
  23. data/lib/nanoc/base/compilation/rules_collection.rb +0 -2
  24. data/lib/nanoc/base/context.rb +0 -2
  25. data/lib/nanoc/base/core_ext.rb +0 -2
  26. data/lib/nanoc/base/core_ext/array.rb +0 -2
  27. data/lib/nanoc/base/core_ext/hash.rb +0 -2
  28. data/lib/nanoc/base/core_ext/pathname.rb +0 -2
  29. data/lib/nanoc/base/core_ext/string.rb +0 -2
  30. data/lib/nanoc/base/directed_graph.rb +0 -2
  31. data/lib/nanoc/base/error.rb +0 -2
  32. data/lib/nanoc/base/errors.rb +0 -2
  33. data/lib/nanoc/base/identifiable_collection.rb +0 -2
  34. data/lib/nanoc/base/memoization.rb +0 -2
  35. data/lib/nanoc/base/notification_center.rb +0 -2
  36. data/lib/nanoc/base/pattern.rb +0 -2
  37. data/lib/nanoc/base/plugin_registry.rb +0 -2
  38. data/lib/nanoc/base/result_data/item_rep.rb +0 -2
  39. data/lib/nanoc/base/source_data/code_snippet.rb +0 -2
  40. data/lib/nanoc/base/source_data/configuration.rb +0 -2
  41. data/lib/nanoc/base/source_data/data_source.rb +0 -2
  42. data/lib/nanoc/base/source_data/identifier.rb +0 -2
  43. data/lib/nanoc/base/source_data/item.rb +0 -2
  44. data/lib/nanoc/base/source_data/layout.rb +0 -2
  45. data/lib/nanoc/base/source_data/site.rb +1 -3
  46. data/lib/nanoc/base/store.rb +0 -2
  47. data/lib/nanoc/base/temp_filename_factory.rb +0 -2
  48. data/lib/nanoc/base/views/config.rb +0 -2
  49. data/lib/nanoc/base/views/identifiable_collection.rb +0 -2
  50. data/lib/nanoc/base/views/item.rb +3 -5
  51. data/lib/nanoc/base/views/item_collection.rb +0 -2
  52. data/lib/nanoc/base/views/item_rep.rb +0 -2
  53. data/lib/nanoc/base/views/item_rep_collection.rb +48 -0
  54. data/lib/nanoc/base/views/layout.rb +0 -2
  55. data/lib/nanoc/base/views/layout_collection.rb +0 -2
  56. data/lib/nanoc/base/views/mutable_config.rb +0 -2
  57. data/lib/nanoc/base/views/mutable_identifiable_collection.rb +0 -2
  58. data/lib/nanoc/base/views/mutable_item.rb +0 -2
  59. data/lib/nanoc/base/views/mutable_item_collection.rb +0 -2
  60. data/lib/nanoc/base/views/mutable_layout.rb +0 -2
  61. data/lib/nanoc/base/views/mutable_layout_collection.rb +0 -2
  62. data/lib/nanoc/base/views/site.rb +0 -2
  63. data/lib/nanoc/cli.rb +0 -2
  64. data/lib/nanoc/cli/ansi_string_colorizer.rb +0 -2
  65. data/lib/nanoc/cli/cleaning_stream.rb +0 -2
  66. data/lib/nanoc/cli/command_runner.rb +0 -2
  67. data/lib/nanoc/cli/commands/check.rb +0 -2
  68. data/lib/nanoc/cli/commands/compile.rb +0 -2
  69. data/lib/nanoc/cli/commands/create-site.rb +7 -25
  70. data/lib/nanoc/cli/commands/deploy.rb +0 -2
  71. data/lib/nanoc/cli/commands/nanoc.rb +0 -2
  72. data/lib/nanoc/cli/commands/prune.rb +0 -2
  73. data/lib/nanoc/cli/commands/shell.rb +0 -2
  74. data/lib/nanoc/cli/commands/show-data.rb +0 -2
  75. data/lib/nanoc/cli/commands/show-plugins.rb +0 -2
  76. data/lib/nanoc/cli/commands/show-rules.rb +0 -2
  77. data/lib/nanoc/cli/commands/view.rb +0 -2
  78. data/lib/nanoc/cli/error_handler.rb +0 -2
  79. data/lib/nanoc/cli/logger.rb +0 -2
  80. data/lib/nanoc/cli/stream_cleaners.rb +0 -2
  81. data/lib/nanoc/cli/stream_cleaners/abstract.rb +0 -2
  82. data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -2
  83. data/lib/nanoc/cli/stream_cleaners/utf8.rb +0 -2
  84. data/lib/nanoc/data_sources.rb +1 -5
  85. data/lib/nanoc/data_sources/filesystem.rb +2 -2
  86. data/lib/nanoc/data_sources/filesystem_unified.rb +0 -2
  87. data/lib/nanoc/extra.rb +0 -2
  88. data/lib/nanoc/extra/checking.rb +0 -2
  89. data/lib/nanoc/extra/checking/check.rb +23 -15
  90. data/lib/nanoc/extra/checking/checks.rb +0 -2
  91. data/lib/nanoc/extra/checking/checks/css.rb +1 -3
  92. data/lib/nanoc/extra/checking/checks/external_links.rb +0 -2
  93. data/lib/nanoc/extra/checking/checks/html.rb +1 -3
  94. data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -5
  95. data/lib/nanoc/extra/checking/checks/mixed_content.rb +0 -2
  96. data/lib/nanoc/extra/checking/checks/stale.rb +2 -4
  97. data/lib/nanoc/extra/checking/dsl.rb +0 -2
  98. data/lib/nanoc/extra/checking/issue.rb +0 -2
  99. data/lib/nanoc/extra/checking/runner.rb +1 -3
  100. data/lib/nanoc/extra/core_ext.rb +0 -2
  101. data/lib/nanoc/extra/core_ext/pathname.rb +0 -2
  102. data/lib/nanoc/extra/core_ext/time.rb +0 -2
  103. data/lib/nanoc/extra/deployer.rb +0 -2
  104. data/lib/nanoc/extra/deployers.rb +0 -2
  105. data/lib/nanoc/extra/deployers/fog.rb +40 -8
  106. data/lib/nanoc/extra/deployers/rsync.rb +0 -2
  107. data/lib/nanoc/extra/filesystem_tools.rb +0 -2
  108. data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -2
  109. data/lib/nanoc/extra/link_collector.rb +0 -2
  110. data/lib/nanoc/extra/piper.rb +0 -2
  111. data/lib/nanoc/extra/pruner.rb +0 -2
  112. data/lib/nanoc/filters.rb +0 -2
  113. data/lib/nanoc/filters/asciidoc.rb +0 -2
  114. data/lib/nanoc/filters/bluecloth.rb +0 -2
  115. data/lib/nanoc/filters/coffeescript.rb +0 -2
  116. data/lib/nanoc/filters/colorize_syntax.rb +0 -2
  117. data/lib/nanoc/filters/erb.rb +0 -2
  118. data/lib/nanoc/filters/erubis.rb +0 -2
  119. data/lib/nanoc/filters/haml.rb +0 -2
  120. data/lib/nanoc/filters/handlebars.rb +0 -2
  121. data/lib/nanoc/filters/kramdown.rb +0 -2
  122. data/lib/nanoc/filters/less.rb +0 -2
  123. data/lib/nanoc/filters/markaby.rb +0 -2
  124. data/lib/nanoc/filters/maruku.rb +0 -2
  125. data/lib/nanoc/filters/mustache.rb +0 -2
  126. data/lib/nanoc/filters/pandoc.rb +0 -2
  127. data/lib/nanoc/filters/rainpress.rb +0 -2
  128. data/lib/nanoc/filters/rdiscount.rb +0 -2
  129. data/lib/nanoc/filters/rdoc.rb +0 -2
  130. data/lib/nanoc/filters/redcarpet.rb +0 -2
  131. data/lib/nanoc/filters/redcloth.rb +0 -2
  132. data/lib/nanoc/filters/relativize_paths.rb +0 -2
  133. data/lib/nanoc/filters/rubypants.rb +0 -2
  134. data/lib/nanoc/filters/sass.rb +0 -2
  135. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
  136. data/lib/nanoc/filters/slim.rb +0 -2
  137. data/lib/nanoc/filters/typogruby.rb +0 -2
  138. data/lib/nanoc/filters/uglify_js.rb +0 -2
  139. data/lib/nanoc/filters/xsl.rb +0 -2
  140. data/lib/nanoc/filters/yui_compressor.rb +0 -2
  141. data/lib/nanoc/helpers.rb +0 -2
  142. data/lib/nanoc/helpers/blogging.rb +0 -2
  143. data/lib/nanoc/helpers/breadcrumbs.rb +0 -2
  144. data/lib/nanoc/helpers/capturing.rb +0 -2
  145. data/lib/nanoc/helpers/filtering.rb +0 -2
  146. data/lib/nanoc/helpers/html_escape.rb +0 -2
  147. data/lib/nanoc/helpers/link_to.rb +0 -2
  148. data/lib/nanoc/helpers/rendering.rb +0 -2
  149. data/lib/nanoc/helpers/tagging.rb +0 -2
  150. data/lib/nanoc/helpers/text.rb +0 -2
  151. data/lib/nanoc/helpers/xml_sitemap.rb +0 -2
  152. data/lib/nanoc/version.rb +1 -3
  153. data/nanoc.gemspec +1 -3
  154. data/tasks/doc.rake +0 -2
  155. data/tasks/test.rake +0 -2
  156. data/test/base/checksummer_spec.rb +0 -2
  157. data/test/base/core_ext/array_spec.rb +0 -2
  158. data/test/base/core_ext/hash_spec.rb +0 -2
  159. data/test/base/core_ext/pathname_spec.rb +0 -2
  160. data/test/base/core_ext/string_spec.rb +0 -2
  161. data/test/base/temp_filename_factory_spec.rb +0 -2
  162. data/test/base/test_checksum_store.rb +0 -2
  163. data/test/base/test_code_snippet.rb +0 -2
  164. data/test/base/test_compiler.rb +0 -2
  165. data/test/base/test_compiler_dsl.rb +1 -3
  166. data/test/base/test_context.rb +0 -2
  167. data/test/base/test_data_source.rb +0 -2
  168. data/test/base/test_dependency_tracker.rb +0 -2
  169. data/test/base/test_directed_graph.rb +0 -2
  170. data/test/base/test_filter.rb +0 -2
  171. data/test/base/test_item.rb +0 -2
  172. data/test/base/test_item_array.rb +0 -2
  173. data/test/base/test_item_rep.rb +0 -2
  174. data/test/base/test_item_rep_recorder_proxy.rb +0 -2
  175. data/test/base/test_layout.rb +0 -2
  176. data/test/base/test_memoization.rb +0 -2
  177. data/test/base/test_notification_center.rb +0 -2
  178. data/test/base/test_outdatedness_checker.rb +1 -3
  179. data/test/base/test_plugin.rb +0 -2
  180. data/test/base/test_rule.rb +0 -2
  181. data/test/base/test_rule_context.rb +0 -2
  182. data/test/base/test_site.rb +1 -3
  183. data/test/base/test_store.rb +0 -2
  184. data/test/cli/commands/test_check.rb +0 -2
  185. data/test/cli/commands/test_compile.rb +0 -2
  186. data/test/cli/commands/test_create_site.rb +1 -3
  187. data/test/cli/commands/test_deploy.rb +0 -2
  188. data/test/cli/commands/test_help.rb +0 -2
  189. data/test/cli/commands/test_info.rb +0 -2
  190. data/test/cli/commands/test_prune.rb +2 -4
  191. data/test/cli/test_cleaning_stream.rb +0 -2
  192. data/test/cli/test_cli.rb +0 -6
  193. data/test/cli/test_error_handler.rb +0 -2
  194. data/test/cli/test_logger.rb +0 -2
  195. data/test/data_sources/test_filesystem.rb +0 -2
  196. data/test/data_sources/test_filesystem_unified.rb +15 -2
  197. data/test/extra/checking/checks/test_css.rb +3 -5
  198. data/test/extra/checking/checks/test_external_links.rb +5 -7
  199. data/test/extra/checking/checks/test_html.rb +2 -4
  200. data/test/extra/checking/checks/test_internal_links.rb +5 -7
  201. data/test/extra/checking/checks/test_mixed_content.rb +8 -10
  202. data/test/extra/checking/checks/test_stale.rb +1 -3
  203. data/test/extra/checking/test_check.rb +2 -6
  204. data/test/extra/checking/test_dsl.rb +0 -2
  205. data/test/extra/checking/test_runner.rb +0 -2
  206. data/test/extra/core_ext/test_pathname.rb +0 -2
  207. data/test/extra/core_ext/test_time.rb +0 -2
  208. data/test/extra/deployers/test_fog.rb +147 -2
  209. data/test/extra/deployers/test_rsync.rb +0 -2
  210. data/test/extra/test_filesystem_tools.rb +0 -2
  211. data/test/extra/test_link_collector.rb +0 -2
  212. data/test/extra/test_piper.rb +0 -2
  213. data/test/filters/test_asciidoc.rb +0 -2
  214. data/test/filters/test_bluecloth.rb +0 -2
  215. data/test/filters/test_coffeescript.rb +0 -2
  216. data/test/filters/test_colorize_syntax.rb +0 -2
  217. data/test/filters/test_erb.rb +0 -2
  218. data/test/filters/test_erubis.rb +0 -2
  219. data/test/filters/test_haml.rb +0 -2
  220. data/test/filters/test_handlebars.rb +0 -2
  221. data/test/filters/test_kramdown.rb +0 -2
  222. data/test/filters/test_less.rb +0 -2
  223. data/test/filters/test_markaby.rb +0 -2
  224. data/test/filters/test_maruku.rb +0 -2
  225. data/test/filters/test_mustache.rb +0 -2
  226. data/test/filters/test_pandoc.rb +0 -2
  227. data/test/filters/test_rainpress.rb +0 -2
  228. data/test/filters/test_rdiscount.rb +0 -2
  229. data/test/filters/test_rdoc.rb +0 -2
  230. data/test/filters/test_redcarpet.rb +0 -2
  231. data/test/filters/test_redcloth.rb +0 -2
  232. data/test/filters/test_relativize_paths.rb +0 -2
  233. data/test/filters/test_rubypants.rb +0 -2
  234. data/test/filters/test_sass.rb +0 -2
  235. data/test/filters/test_slim.rb +0 -2
  236. data/test/filters/test_typogruby.rb +0 -2
  237. data/test/filters/test_uglify_js.rb +0 -2
  238. data/test/filters/test_xsl.rb +0 -2
  239. data/test/filters/test_yui_compressor.rb +0 -2
  240. data/test/gem_loader.rb +0 -2
  241. data/test/helper.rb +1 -3
  242. data/test/helpers/test_blogging.rb +0 -2
  243. data/test/helpers/test_breadcrumbs.rb +0 -2
  244. data/test/helpers/test_capturing.rb +0 -2
  245. data/test/helpers/test_filtering.rb +0 -2
  246. data/test/helpers/test_html_escape.rb +0 -2
  247. data/test/helpers/test_link_to.rb +0 -2
  248. data/test/helpers/test_rendering.rb +0 -2
  249. data/test/helpers/test_tagging.rb +0 -2
  250. data/test/helpers/test_text.rb +0 -2
  251. data/test/helpers/test_xml_sitemap.rb +0 -2
  252. data/test/test_gem.rb +0 -5
  253. metadata +5 -6
  254. data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -71
  255. data/test/data_sources/test_filesystem_verbose.rb +0 -308
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class Identifier
5
3
  include Comparable
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::Int
4
2
  # Represents a compileable item in a site. It has content and attributes, as
5
3
  # well as an identifier (which starts and ends with a slash). It can also
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::Int
4
2
  # Represents a layout in a nanoc site. It has content, attributes, an
5
3
  # identifier and a modification time (to speed up compilation).
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::Int
4
2
  # The in-memory representation of a nanoc site. It holds references to the
5
3
  # following site data:
@@ -21,7 +19,7 @@ module Nanoc::Int
21
19
  # The default configuration for a data source. A data source's
22
20
  # configuration overrides these options.
23
21
  DEFAULT_DATA_SOURCE_CONFIG = {
24
- type: 'filesystem_unified',
22
+ type: 'filesystem',
25
23
  items_root: '/',
26
24
  layouts_root: '/',
27
25
  config: {},
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::Int
4
2
  # An abstract superclass for classes that need to store data to the
5
3
  # filesystem, such as checksums, cached compiled content and dependency
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'tmpdir'
4
2
 
5
3
  module Nanoc::Int
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class ConfigView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class IdentifiableCollectionView
5
3
  include Enumerable
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class ItemView
5
3
  # @api private
@@ -107,7 +105,7 @@ module Nanoc
107
105
  #
108
106
  # @return [nil] if the item has no parent
109
107
  def parent
110
- Nanoc::ItemView.new(@item.parent)
108
+ @item.parent && Nanoc::ItemView.new(@item.parent)
111
109
  end
112
110
 
113
111
  # @return [Boolean] True if the item is binary, false otherwise
@@ -127,9 +125,9 @@ module Nanoc
127
125
 
128
126
  # Returns the representations of this item.
129
127
  #
130
- # @return [Enumerable<Nanoc::ItemRepView>]
128
+ # @return [Nanoc::ItemRepCollectionView]
131
129
  def reps
132
- @item.reps.map { |r| Nanoc::ItemRepView.new(r) }
130
+ Nanoc::ItemRepCollectionView.new(@item.reps)
133
131
  end
134
132
 
135
133
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class ItemCollectionView < ::Nanoc::IdentifiableCollectionView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class ItemRepView
5
3
  # @api private
@@ -0,0 +1,48 @@
1
+ module Nanoc
2
+ class ItemRepCollectionView
3
+ include Enumerable
4
+
5
+ # @api private
6
+ def initialize(item_reps)
7
+ @item_reps = item_reps
8
+ end
9
+
10
+ # @api private
11
+ def unwrap
12
+ @item_reps
13
+ end
14
+
15
+ def to_ary
16
+ @item_reps.map { |ir| Nanoc::ItemRepView.new(ir) }
17
+ end
18
+
19
+ # Calls the given block once for each item rep, passing that item rep as a parameter.
20
+ #
21
+ # @yieldparam [Nanoc::ItemRepView] item rep
22
+ #
23
+ # @yieldreturn [void]
24
+ #
25
+ # @return [self]
26
+ def each
27
+ @item_reps.each { |ir| yield Nanoc::ItemRepView.new(ir) }
28
+ self
29
+ end
30
+
31
+ # @return [Integer]
32
+ def size
33
+ @item_reps.size
34
+ end
35
+
36
+ # Return the item rep with the given name, or nil if no item rep exists.
37
+ #
38
+ # @param [Symbol] rep_name
39
+ #
40
+ # @return [nil] if no item rep with the given name was found
41
+ #
42
+ # @return [Nanoc::ItemRepView] if an item rep with the given name was found
43
+ def [](rep_name)
44
+ res = @item_reps.find { |ir| ir.name == rep_name }
45
+ res && Nanoc::ItemRepView.new(res)
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class LayoutView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class LayoutCollectionView < ::Nanoc::IdentifiableCollectionView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableConfigView < Nanoc::ConfigView
5
3
  # Sets the value for the given attribute.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableIdentifiableCollectionView < Nanoc::IdentifiableCollectionView
5
3
  # Deletes every object for which the block evaluates to true.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableItemView < Nanoc::ItemView
5
3
  # Sets the value for the given attribute.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableItemCollectionView < Nanoc::MutableIdentifiableCollectionView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableLayoutView < Nanoc::LayoutView
5
3
  # Sets the value for the given attribute.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class MutableLayoutCollectionView < Nanoc::MutableIdentifiableCollectionView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc
4
2
  class SiteView
5
3
  # @api private
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  begin
4
2
  require 'cri'
5
3
  rescue LoadError => e
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI
4
2
  # A simple ANSI colorizer for strings. When given a string and a list of
5
3
  # attributes, it returns a colorized string.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI
4
2
  # An output stream that passes output through stream cleaners. This can be
5
3
  # used to strip ANSI color sequences, for instance.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI
4
2
  # A command runner subclass for nanoc commands that adds nanoc-specific
5
3
  # convenience methods and error handling.
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'check [options] [names]'
4
2
  summary 'run issue checks'
5
3
  description "
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'compile [options]'
4
2
  summary 'compile items of this site'
5
3
  description <<-EOS
@@ -1,11 +1,7 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'create-site [options] path'
4
2
  aliases :create_site, :cs
5
3
  summary 'create a site'
6
- description "
7
- Create a new site at the given path. The site will use the `filesystem_unified` data source by default, but this can be changed using the `--datasource` command-line option.
8
- "
4
+ description "Create a new site at the given path. The site will use the `filesystem` data source."
9
5
  flag nil, :force, "Force creation of new site. Disregards previous existence of site in destination"
10
6
 
11
7
  module Nanoc::CLI::Commands
@@ -62,8 +58,7 @@ prune:
62
58
  # “layout/” directories in the site directory.
63
59
  data_sources:
64
60
  -
65
- # The type is the identifier of the data source. By default, this will be
66
- # `filesystem_unified`.
61
+ # The type is the identifier of the data source.
67
62
  type: #{Nanoc::Int::Site::DEFAULT_DATA_SOURCE_CONFIG[:type]}
68
63
 
69
64
  # The path where items should be mounted (comparable to mount points in
@@ -77,18 +72,13 @@ data_sources:
77
72
  # same as the items root, but applies to layouts rather than items.
78
73
  layouts_root: #{Nanoc::Int::Site::DEFAULT_DATA_SOURCE_CONFIG[:layouts_root]}
79
74
 
80
- # Whether to allow periods in identifiers. When turned off, everything
81
- # past the first period is considered to be the extension, and when
82
- # turned on, only the characters past the last period are considered to
83
- # be the extension. For example, a file named “content/about.html.erb”
84
- # will have the identifier “/about/” when turned off, but when turned on
85
- # it will become “/about.html/” instead.
86
- allow_periods_in_identifiers: false
87
-
88
75
  # The encoding to use for input files. If your input files are not in
89
76
  # UTF-8 (which they should be!), change this.
90
77
  encoding: utf-8
91
78
 
79
+ # The kind of identifier to use for items and layouts. The default is
80
+ # “full”, meaning that identifiers include file extensions. This can also
81
+ # be “legacy”, primarily used by older nanoc sites.
92
82
  identifier_type: full
93
83
 
94
84
  # Configuration for the “check” command, which run unit tests on the site.
@@ -291,14 +281,11 @@ EOS
291
281
  EOS
292
282
 
293
283
  def run
294
- # Check arguments
284
+ # Extract arguments
295
285
  if arguments.length != 1
296
286
  raise Nanoc::Int::Errors::GenericTrivial, "usage: #{command.usage}"
297
287
  end
298
-
299
- # Extract arguments and options
300
- path = arguments[0]
301
- data_source = options[:datasource] || 'filesystem_unified'
288
+ path = arguments[0]
302
289
 
303
290
  # Check whether site exists
304
291
  if File.exist?(path) && (!File.directory?(path) || !(Dir.entries(path) - %w{ . .. }).empty?) && !options[:force]
@@ -307,11 +294,6 @@ EOS
307
294
  "Re-run the command using --force to create the site anyway."
308
295
  end
309
296
 
310
- # Check whether data source exists
311
- if Nanoc::DataSource.named(data_source).nil?
312
- raise Nanoc::Int::Errors::GenericTrivial, "Unrecognised data source: #{data_source}"
313
- end
314
-
315
297
  # Setup notifications
316
298
  Nanoc::Int::NotificationCenter.on(:file_created) do |file_path|
317
299
  Nanoc::CLI::Logger.instance.file(:high, :create, file_path)
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'deploy [options]'
4
2
  summary 'deploy the compiled site'
5
3
  description "
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'nanoc command [options] [arguments]'
4
2
  summary 'nanoc, a static site compiler written in Ruby'
5
3
 
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'prune'
4
2
  summary 'remove files not managed by nanoc from the output directory'
5
3
  description <<-EOS
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'shell'
4
2
  summary 'open a shell on the nanoc environment'
5
3
  aliases 'console'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'show-data'
4
2
  aliases :debug
5
3
  summary 'show data in this site'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  summary 'show all available plugins'
4
2
  aliases :info
5
3
  usage 'show-plugins [options]'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'show-rules [thing]'
4
2
  aliases :explain
5
3
  summary 'describe the rules for each item'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  usage 'view [options]'
4
2
  summary 'start the web server that serves static files'
5
3
  description <<-EOS
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI
4
2
  # Catches errors and prints nice diagnostic messages, then exits.
5
3
  #
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'singleton'
4
2
 
5
3
  module Nanoc::CLI
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI
4
2
  # @api private
5
3
  module StreamCleaners
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI::StreamCleaners
4
2
  # Superclass for all stream cleaners. Stream cleaners have a single method,
5
3
  # {#clean}, that takes a string and returns a cleaned string. Stream cleaners
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI::StreamCleaners
4
2
  # Removes ANSI color escape sequences.
5
3
  #
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::CLI::StreamCleaners
4
2
  # Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
5
3
  #
@@ -1,12 +1,8 @@
1
- # encoding: utf-8
2
-
3
1
  # @api private
4
2
  module Nanoc::DataSources
5
3
  autoload 'Filesystem', 'nanoc/data_sources/filesystem'
6
4
  autoload 'FilesystemUnified', 'nanoc/data_sources/filesystem_unified'
7
- autoload 'FilesystemVerbose', 'nanoc/data_sources/filesystem_verbose'
8
5
 
9
- Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemVerbose', :filesystem_verbose
10
6
  Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemUnified', :filesystem_unified
11
- Nanoc::DataSource.register '::Nanoc::DataSources::Static', :static
7
+ Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemUnified', :filesystem
12
8
  end
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Nanoc::DataSources
4
2
  # Provides functionality common across all filesystem data sources.
5
3
  #
@@ -47,6 +45,8 @@ module Nanoc::DataSources
47
45
  def load_objects(dir_name, kind, klass)
48
46
  res = []
49
47
 
48
+ return [] if dir_name.nil?
49
+
50
50
  all_split_files_in(dir_name).each do |base_filename, (meta_ext, content_exts)|
51
51
  content_exts.each do |content_ext|
52
52
  # Get filenames