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,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
+ # @api private
3
4
  module Nanoc::Extra::Checking::Checks
4
5
  autoload 'CSS', 'nanoc/extra/checking/checks/css'
5
6
  autoload 'ExternalLinks', 'nanoc/extra/checking/checks/external_links'
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ::Nanoc::Extra::Checking::Checks
4
+ # @api private
4
5
  class CSS < ::Nanoc::Extra::Checking::Check
5
6
  identifier :css
6
7
 
@@ -8,6 +8,8 @@ require 'uri'
8
8
 
9
9
  module ::Nanoc::Extra::Checking::Checks
10
10
  # A validator that verifies that all external links point to a location that exists.
11
+ #
12
+ # @api private
11
13
  class ExternalLinks < ::Nanoc::Extra::Checking::Check
12
14
  identifiers :external_links, :elinks
13
15
 
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ::Nanoc::Extra::Checking::Checks
4
+ # @api private
4
5
  class HTML < ::Nanoc::Extra::Checking::Check
5
6
  identifier :html
6
7
 
@@ -4,6 +4,8 @@ require 'uri'
4
4
 
5
5
  module Nanoc::Extra::Checking::Checks
6
6
  # A check that verifies that all internal links point to a location that exists.
7
+ #
8
+ # @api private
7
9
  class InternalLinks < ::Nanoc::Extra::Checking::Check
8
10
  # Starts the validator. The results will be printed to stdout.
9
11
  #
@@ -3,6 +3,8 @@
3
3
  module Nanoc::Extra::Checking::Checks
4
4
  # A check that verifies HTML files do not reference external resources with
5
5
  # URLs that would trigger "mixed content" warnings.
6
+ #
7
+ # @api private
6
8
  class MixedContent < ::Nanoc::Extra::Checking::Check
7
9
  PROTOCOL_PATTERN = /^(\w+):\/\//
8
10
 
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Extra::Checking::Checks
4
+ # @api private
4
5
  class Stale < ::Nanoc::Extra::Checking::Check
5
6
  def run
6
7
  require 'set'
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Extra::Checking
4
+ # @api private
4
5
  class DSL
5
6
  attr_reader :deploy_checks
6
7
 
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Extra::Checking
4
+ # @api private
4
5
  class Issue
5
6
  attr_reader :description
6
7
  attr_reader :subject
@@ -7,7 +7,7 @@ module Nanoc::Extra::Checking
7
7
  class Runner
8
8
  CHECKS_FILENAMES = ['Checks', 'Checks.rb', 'checks', 'checks.rb']
9
9
 
10
- # @param [Nanoc::Site] site The nanoc site this runner is for
10
+ # @param [Nanoc::Int::Site] site The nanoc site this runner is for
11
11
  def initialize(site)
12
12
  @site = site
13
13
  end
@@ -81,7 +81,7 @@ module Nanoc::Extra::Checking
81
81
  def require_dsl
82
82
  load_dsl_if_available
83
83
  if dsl.nil?
84
- raise Nanoc::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
84
+ raise Nanoc::Int::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
85
85
  end
86
86
  end
87
87
 
@@ -102,7 +102,7 @@ module Nanoc::Extra::Checking
102
102
  def check_classes_named(n)
103
103
  n.map do |a|
104
104
  klass = Nanoc::Extra::Checking::Check.named(a)
105
- raise Nanoc::Errors::GenericTrivial, "Unknown check: #{a}" if klass.nil?
105
+ raise Nanoc::Int::Errors::GenericTrivial, "Unknown check: #{a}" if klass.nil?
106
106
  klass
107
107
  end
108
108
  end
@@ -1,8 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Extra
4
+ # @api private
4
5
  module PathnameExtensions
5
- def components
6
+ def __nanoc_components
6
7
  components = []
7
8
  tmp = self
8
9
  loop do
@@ -14,12 +15,13 @@ module Nanoc::Extra
14
15
  components.reverse
15
16
  end
16
17
 
17
- def include_component?(component)
18
- components.include?(component)
18
+ def __nanoc_include_component?(component)
19
+ __nanoc_components.include?(component)
19
20
  end
20
21
  end
21
22
  end
22
23
 
24
+ # @api private
23
25
  class ::Pathname
24
26
  include ::Nanoc::Extra::PathnameExtensions
25
27
  end
@@ -1,17 +1,19 @@
1
1
  # encoding: utf-8
2
2
 
3
+ # @api private
3
4
  module Nanoc::Extra::TimeExtensions
4
5
  # @return [String] The time in an ISO-8601 date format.
5
- def to_iso8601_date
6
+ def __nanoc_to_iso8601_date
6
7
  strftime('%Y-%m-%d')
7
8
  end
8
9
 
9
10
  # @return [String] The time in an ISO-8601 time format.
10
- def to_iso8601_time
11
+ def __nanoc_to_iso8601_time
11
12
  getutc.strftime('%Y-%m-%dT%H:%M:%SZ')
12
13
  end
13
14
  end
14
15
 
16
+ # @api private
15
17
  class Time
16
18
  include Nanoc::Extra::TimeExtensions
17
19
  end
@@ -5,8 +5,10 @@ module Nanoc::Extra
5
5
  # to a specific (remote) location.
6
6
  #
7
7
  # @abstract Subclass and override {#run} to implement a custom filter.
8
+ #
9
+ # @api private
8
10
  class Deployer
9
- extend Nanoc::PluginRegistry::PluginMethods
11
+ extend Nanoc::Int::PluginRegistry::PluginMethods
10
12
 
11
13
  # @return [String] The path to the directory that contains the files to
12
14
  # upload. It should not have a trailing slash.
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Extra
4
+ # @api private
4
5
  module Deployers
5
6
  autoload 'Fog', 'nanoc/extra/deployers/fog'
6
7
  autoload 'Rsync', 'nanoc/extra/deployers/rsync'
@@ -20,6 +20,8 @@ module Nanoc::Extra::Deployers
20
20
  # provider: local
21
21
  # local_root: ~/myCloud
22
22
  # bucket: nanoc-site-staging
23
+ #
24
+ # @api private
23
25
  class Fog < ::Nanoc::Extra::Deployer
24
26
  # @see Nanoc::Extra::Deployer#run
25
27
  def run
@@ -18,6 +18,8 @@ module Nanoc::Extra::Deployers
18
18
  # kind: rsync
19
19
  # dst: "ectype:sites/stoneship-staging/public"
20
20
  # options: [ "-glpPrtvz" ]
21
+ #
22
+ # @api private
21
23
  class Rsync < ::Nanoc::Extra::Deployer
22
24
  # Default rsync options
23
25
  DEFAULT_OPTIONS = [
@@ -6,9 +6,7 @@ module Nanoc::Extra
6
6
  # @api private
7
7
  module FilesystemTools
8
8
  # Error that is raised when too many symlink indirections are encountered.
9
- #
10
- # @api private
11
- class MaxSymlinkDepthExceededError < ::Nanoc::Errors::GenericTrivial
9
+ class MaxSymlinkDepthExceededError < ::Nanoc::Int::Errors::GenericTrivial
12
10
  # @return [String] The last filename that was attempted to be
13
11
  # resolved before giving up
14
12
  attr_reader :filename
@@ -23,9 +21,7 @@ module Nanoc::Extra
23
21
 
24
22
  # Error that is raised when a file of an unknown type is encountered
25
23
  # (something other than file, directory or link).
26
- #
27
- # @api private
28
- class UnsupportedFileTypeError < ::Nanoc::Errors::GenericTrivial
24
+ class UnsupportedFileTypeError < ::Nanoc::Int::Errors::GenericTrivial
29
25
  # @return [String] The filename of the file whose type is not supported
30
26
  attr_reader :filename
31
27
 
@@ -106,7 +102,7 @@ module Nanoc::Extra
106
102
  when Array
107
103
  patterns.concat(extra_files.map { |extra_file| "#{dir_name}/#{extra_file}" })
108
104
  else
109
- raise Nanoc::Errors::GenericTrivial,
105
+ raise Nanoc::Int::Errors::GenericTrivial,
110
106
  "Do not know how to handle extra_files: #{extra_files.inspect}"
111
107
  end
112
108
  Dir.glob(patterns)
@@ -3,6 +3,7 @@
3
3
  require 'singleton'
4
4
 
5
5
  module Nanoc::Extra
6
+ # @api private
6
7
  class JRubyNokogiriWarner
7
8
  include Singleton
8
9
 
@@ -3,6 +3,7 @@
3
3
  require 'set'
4
4
 
5
5
  module ::Nanoc::Extra
6
+ # @api private
6
7
  class LinkCollector
7
8
  URI_ATTRS = {
8
9
  'a' => :href,
@@ -3,8 +3,9 @@
3
3
  require 'open3'
4
4
 
5
5
  module Nanoc::Extra
6
+ # @api private
6
7
  class Piper
7
- class Error < ::Nanoc::Errors::Generic
8
+ class Error < ::Nanoc::Int::Errors::Generic
8
9
  def initialize(command, exit_code)
9
10
  @command = command
10
11
  @exit_code = exit_code
@@ -3,11 +3,13 @@
3
3
  module Nanoc::Extra
4
4
  # Responsible for finding and deleting files in the site’s output directory
5
5
  # that are not managed by nanoc.
6
+ #
7
+ # @api private
6
8
  class Pruner
7
- # @return [Nanoc::Site] The site this pruner belongs to
9
+ # @return [Nanoc::Int::Site] The site this pruner belongs to
8
10
  attr_reader :site
9
11
 
10
- # @param [Nanoc::Site] site The site for which a pruner is created
12
+ # @param [Nanoc::Int::Site] site The site for which a pruner is created
11
13
  #
12
14
  # @option params [Boolean] :dry_run (false) true if the files to be deleted
13
15
  # should only be printed instead of actually deleted, false if the files
@@ -58,7 +60,7 @@ module Nanoc::Extra
58
60
  # @return [Boolean] true if the given file is excluded, false otherwise
59
61
  def filename_excluded?(filename)
60
62
  pathname = Pathname.new(filename)
61
- @exclude.any? { |e| pathname.include_component?(e) }
63
+ @exclude.any? { |e| pathname.__nanoc_include_component?(e) }
62
64
  end
63
65
 
64
66
  protected
@@ -1,9 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
+ # @api private
3
4
  module Nanoc::Filters
4
5
  autoload 'AsciiDoc', 'nanoc/filters/asciidoc'
5
6
  autoload 'BlueCloth', 'nanoc/filters/bluecloth'
6
- autoload 'CodeRay', 'nanoc/filters/coderay'
7
7
  autoload 'ColorizeSyntax', 'nanoc/filters/colorize_syntax'
8
8
  autoload 'CoffeeScript', 'nanoc/filters/coffeescript'
9
9
  autoload 'ERB', 'nanoc/filters/erb'
@@ -32,7 +32,6 @@ module Nanoc::Filters
32
32
 
33
33
  Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
34
34
  Nanoc::Filter.register '::Nanoc::Filters::BlueCloth', :bluecloth
35
- Nanoc::Filter.register '::Nanoc::Filters::CodeRay', :coderay
36
35
  Nanoc::Filter.register '::Nanoc::Filters::ColorizeSyntax', :colorize_syntax
37
36
  Nanoc::Filter.register '::Nanoc::Filters::CoffeeScript', :coffeescript
38
37
  Nanoc::Filter.register '::Nanoc::Filters::ERB', :erb
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  # @since 3.2.0
5
+ #
6
+ # @api private
5
7
  class AsciiDoc < Nanoc::Filter
6
8
  # Runs the content through [AsciiDoc](http://www.methods.co.nz/asciidoc/).
7
9
  # This method takes no options.
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
+ # @api private
4
5
  class BlueCloth < Nanoc::Filter
5
6
  requires 'bluecloth'
6
7
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  # @since 3.3.0
5
+ #
6
+ # @api private
5
7
  class CoffeeScript < Nanoc::Filter
6
8
  requires 'coffee-script'
7
9
 
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
+ # @api private
4
5
  class ColorizeSyntax < Nanoc::Filter
5
6
  requires 'nokogiri', 'stringio', 'open3'
6
7
 
@@ -155,8 +156,6 @@ module Nanoc::Filters
155
156
  #
156
157
  # @param [Boolean] is_fullpage true if the given content is a full page,
157
158
  # false if it is a fragment
158
- #
159
- # @api private
160
159
  def parse(content, klass, is_fullpage)
161
160
  if is_fullpage
162
161
  klass.parse(content, nil, 'UTF-8')
@@ -173,8 +172,6 @@ module Nanoc::Filters
173
172
 
174
173
  # Runs the code through [CodeRay](http://coderay.rubychan.de/).
175
174
  #
176
- # @api private
177
- #
178
175
  # @param [String] code The code to colorize
179
176
  #
180
177
  # @param [String] language The language the code is written in
@@ -203,8 +200,6 @@ module Nanoc::Filters
203
200
  # Runs the content through [pygmentize](http://pygments.org/docs/cmdline/),
204
201
  # the command-line frontend for [Pygments](http://pygments.org/).
205
202
  #
206
- # @api private
207
- #
208
203
  # @param [String] code The code to colorize
209
204
  #
210
205
  # @param [String] language The language the code is written in
@@ -232,8 +227,6 @@ module Nanoc::Filters
232
227
  # Runs the content through [Pygments](http://pygments.org/) via
233
228
  # [pygments.rb](https://github.com/tmm1/pygments.rb).
234
229
  #
235
- # @api private
236
- #
237
230
  # @param [String] code The code to colorize
238
231
  #
239
232
  # @param [String] language The language the code is written in
@@ -259,8 +252,6 @@ module Nanoc::Filters
259
252
 
260
253
  # Runs the content through [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.html).
261
254
  #
262
- # @api private
263
- #
264
255
  # @since 3.2.0
265
256
  #
266
257
  # @param [String] code The code to colorize
@@ -315,8 +306,6 @@ module Nanoc::Filters
315
306
 
316
307
  # Runs the content through [Rouge](https://github.com/jayferd/rouge/.
317
308
  #
318
- # @api private
319
- #
320
309
  # @param [String] code The code to colorize
321
310
  #
322
311
  # @param [String] language The language the code is written in
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
+ # @api private
4
5
  class ERB < Nanoc::Filter
5
6
  requires 'erb'
6
7
 
@@ -19,7 +20,7 @@ module Nanoc::Filters
19
20
  assigns.merge!(params[:locals] || {})
20
21
 
21
22
  # Create context
22
- context = ::Nanoc::Context.new(assigns)
23
+ context = ::Nanoc::Int::Context.new(assigns)
23
24
 
24
25
  # Get binding
25
26
  proc = assigns[:content] ? -> { assigns[:content] } : nil
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
+ # @api private
4
5
  class Erubis < Nanoc::Filter
5
6
  requires 'erubis'
6
7
 
@@ -19,7 +20,7 @@ module Nanoc::Filters
19
20
  # @return [String] The filtered content
20
21
  def run(content, _params = {})
21
22
  # Create context
22
- context = ::Nanoc::Context.new(assigns)
23
+ context = ::Nanoc::Int::Context.new(assigns)
23
24
 
24
25
  # Get binding
25
26
  proc = assigns[:content] ? -> { assigns[:content] } : nil
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
+ # @api private
4
5
  class Haml < Nanoc::Filter
5
6
  requires 'haml'
6
7
 
@@ -15,7 +16,7 @@ module Nanoc::Filters
15
16
  options = params.merge(filename: filename)
16
17
 
17
18
  # Create context
18
- context = ::Nanoc::Context.new(assigns)
19
+ context = ::Nanoc::Int::Context.new(assigns)
19
20
 
20
21
  # Get result
21
22
  proc = assigns[:content] ? -> { assigns[:content] } : nil
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  # @since 3.4.0
5
+ #
6
+ # @api private
5
7
  class Handlebars < Nanoc::Filter
6
8
  requires 'handlebars'
7
9