nanoc 3.7.4 → 3.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +19 -18
  3. data/LICENSE +1 -1
  4. data/NEWS.md +14 -0
  5. data/Rakefile +1 -1
  6. data/doc/yardoc_handlers/identifier.rb +1 -5
  7. data/lib/nanoc.rb +1 -3
  8. data/lib/nanoc/base.rb +1 -4
  9. data/lib/nanoc/base/checksummer.rb +10 -12
  10. data/lib/nanoc/base/compilation/checksum_store.rb +0 -4
  11. data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -4
  12. data/lib/nanoc/base/compilation/compiler.rb +27 -31
  13. data/lib/nanoc/base/compilation/compiler_dsl.rb +3 -7
  14. data/lib/nanoc/base/compilation/dependency_tracker.rb +2 -6
  15. data/lib/nanoc/base/compilation/filter.rb +1 -7
  16. data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -4
  17. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -4
  18. data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -4
  19. data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -6
  20. data/lib/nanoc/base/compilation/rule.rb +1 -5
  21. data/lib/nanoc/base/compilation/rule_context.rb +7 -11
  22. data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -4
  23. data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -4
  24. data/lib/nanoc/base/compilation/rules_collection.rb +5 -9
  25. data/lib/nanoc/base/context.rb +0 -3
  26. data/lib/nanoc/base/core_ext.rb +0 -1
  27. data/lib/nanoc/base/core_ext/array.rb +0 -2
  28. data/lib/nanoc/base/core_ext/hash.rb +0 -2
  29. data/lib/nanoc/base/core_ext/pathname.rb +0 -2
  30. data/lib/nanoc/base/core_ext/string.rb +0 -2
  31. data/lib/nanoc/base/directed_graph.rb +0 -4
  32. data/lib/nanoc/base/errors.rb +1 -39
  33. data/lib/nanoc/base/memoization.rb +0 -4
  34. data/lib/nanoc/base/notification_center.rb +1 -7
  35. data/lib/nanoc/base/plugin_registry.rb +4 -10
  36. data/lib/nanoc/base/result_data/item_rep.rb +8 -16
  37. data/lib/nanoc/base/source_data/code_snippet.rb +1 -5
  38. data/lib/nanoc/base/source_data/configuration.rb +0 -4
  39. data/lib/nanoc/base/source_data/data_source.rb +2 -5
  40. data/lib/nanoc/base/source_data/item.rb +3 -7
  41. data/lib/nanoc/base/source_data/item_array.rb +1 -5
  42. data/lib/nanoc/base/source_data/layout.rb +2 -6
  43. data/lib/nanoc/base/source_data/site.rb +20 -23
  44. data/lib/nanoc/base/store.rb +1 -5
  45. data/lib/nanoc/base/temp_filename_factory.rb +0 -4
  46. data/lib/nanoc/cli.rb +3 -5
  47. data/lib/nanoc/cli/ansi_string_colorizer.rb +6 -10
  48. data/lib/nanoc/cli/cleaning_stream.rb +2 -6
  49. data/lib/nanoc/cli/command_runner.rb +1 -5
  50. data/lib/nanoc/cli/commands/autocompile.rb +2 -6
  51. data/lib/nanoc/cli/commands/check.rb +0 -4
  52. data/lib/nanoc/cli/commands/compile.rb +12 -27
  53. data/lib/nanoc/cli/commands/create-item.rb +1 -5
  54. data/lib/nanoc/cli/commands/create-layout.rb +0 -4
  55. data/lib/nanoc/cli/commands/create-site.rb +2 -8
  56. data/lib/nanoc/cli/commands/deploy.rb +3 -7
  57. data/lib/nanoc/cli/commands/prune.rb +2 -6
  58. data/lib/nanoc/cli/commands/shell.rb +4 -8
  59. data/lib/nanoc/cli/commands/show-data.rb +3 -7
  60. data/lib/nanoc/cli/commands/show-plugins.rb +3 -7
  61. data/lib/nanoc/cli/commands/show-rules.rb +11 -15
  62. data/lib/nanoc/cli/commands/sync.rb +0 -4
  63. data/lib/nanoc/cli/commands/update.rb +1 -7
  64. data/lib/nanoc/cli/commands/validate-css.rb +0 -4
  65. data/lib/nanoc/cli/commands/validate-html.rb +0 -4
  66. data/lib/nanoc/cli/commands/validate-links.rb +0 -4
  67. data/lib/nanoc/cli/commands/view.rb +3 -7
  68. data/lib/nanoc/cli/commands/watch.rb +4 -10
  69. data/lib/nanoc/cli/error_handler.rb +9 -13
  70. data/lib/nanoc/cli/logger.rb +8 -12
  71. data/lib/nanoc/cli/stream_cleaners.rb +0 -4
  72. data/lib/nanoc/cli/stream_cleaners/abstract.rb +1 -5
  73. data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -4
  74. data/lib/nanoc/cli/stream_cleaners/utf8.rb +1 -5
  75. data/lib/nanoc/data_sources.rb +2 -4
  76. data/lib/nanoc/data_sources/deprecated/delicious.rb +6 -10
  77. data/lib/nanoc/data_sources/deprecated/last_fm.rb +7 -11
  78. data/lib/nanoc/data_sources/deprecated/twitter.rb +2 -6
  79. data/lib/nanoc/data_sources/filesystem.rb +10 -13
  80. data/lib/nanoc/data_sources/filesystem_unified.rb +0 -4
  81. data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -4
  82. data/lib/nanoc/data_sources/static.rb +4 -8
  83. data/lib/nanoc/extra.rb +2 -4
  84. data/lib/nanoc/extra/auto_compiler.rb +2 -6
  85. data/lib/nanoc/extra/checking.rb +0 -4
  86. data/lib/nanoc/extra/checking/check.rb +0 -4
  87. data/lib/nanoc/extra/checking/checks.rb +0 -2
  88. data/lib/nanoc/extra/checking/checks/css.rb +6 -6
  89. data/lib/nanoc/extra/checking/checks/external_links.rb +3 -11
  90. data/lib/nanoc/extra/checking/checks/html.rb +6 -6
  91. data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -7
  92. data/lib/nanoc/extra/checking/checks/stale.rb +3 -7
  93. data/lib/nanoc/extra/checking/dsl.rb +0 -4
  94. data/lib/nanoc/extra/checking/issue.rb +0 -4
  95. data/lib/nanoc/extra/checking/runner.rb +4 -7
  96. data/lib/nanoc/extra/chick.rb +7 -17
  97. data/lib/nanoc/extra/core_ext.rb +0 -1
  98. data/lib/nanoc/extra/core_ext/pathname.rb +0 -4
  99. data/lib/nanoc/extra/core_ext/time.rb +0 -2
  100. data/lib/nanoc/extra/deployer.rb +0 -4
  101. data/lib/nanoc/extra/deployers.rb +0 -4
  102. data/lib/nanoc/extra/deployers/fog.rb +7 -11
  103. data/lib/nanoc/extra/deployers/rsync.rb +1 -5
  104. data/lib/nanoc/extra/file_proxy.rb +1 -5
  105. data/lib/nanoc/extra/filesystem_tools.rb +37 -12
  106. data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -4
  107. data/lib/nanoc/extra/link_collector.rb +3 -7
  108. data/lib/nanoc/extra/piper.rb +0 -6
  109. data/lib/nanoc/extra/pruner.rb +1 -7
  110. data/lib/nanoc/extra/validators.rb +0 -4
  111. data/lib/nanoc/extra/validators/links.rb +0 -4
  112. data/lib/nanoc/extra/validators/w3c.rb +0 -4
  113. data/lib/nanoc/extra/vcs.rb +3 -7
  114. data/lib/nanoc/extra/vcses.rb +0 -2
  115. data/lib/nanoc/extra/vcses/bazaar.rb +0 -4
  116. data/lib/nanoc/extra/vcses/dummy.rb +0 -4
  117. data/lib/nanoc/extra/vcses/git.rb +0 -4
  118. data/lib/nanoc/extra/vcses/mercurial.rb +0 -4
  119. data/lib/nanoc/extra/vcses/subversion.rb +0 -4
  120. data/lib/nanoc/filters.rb +0 -2
  121. data/lib/nanoc/filters/asciidoc.rb +1 -5
  122. data/lib/nanoc/filters/bluecloth.rb +0 -2
  123. data/lib/nanoc/filters/coderay.rb +0 -2
  124. data/lib/nanoc/filters/coffeescript.rb +0 -4
  125. data/lib/nanoc/filters/colorize_syntax.rb +17 -15
  126. data/lib/nanoc/filters/erb.rb +1 -3
  127. data/lib/nanoc/filters/erubis.rb +2 -4
  128. data/lib/nanoc/filters/haml.rb +2 -4
  129. data/lib/nanoc/filters/handlebars.rb +0 -4
  130. data/lib/nanoc/filters/kramdown.rb +7 -4
  131. data/lib/nanoc/filters/less.rb +1 -3
  132. data/lib/nanoc/filters/markaby.rb +0 -2
  133. data/lib/nanoc/filters/maruku.rb +0 -2
  134. data/lib/nanoc/filters/mustache.rb +1 -5
  135. data/lib/nanoc/filters/pandoc.rb +0 -2
  136. data/lib/nanoc/filters/rainpress.rb +0 -2
  137. data/lib/nanoc/filters/rdiscount.rb +0 -2
  138. data/lib/nanoc/filters/rdoc.rb +0 -2
  139. data/lib/nanoc/filters/redcarpet.rb +0 -4
  140. data/lib/nanoc/filters/redcloth.rb +0 -2
  141. data/lib/nanoc/filters/relativize_paths.rb +2 -4
  142. data/lib/nanoc/filters/rubypants.rb +0 -2
  143. data/lib/nanoc/filters/sass.rb +2 -4
  144. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
  145. data/lib/nanoc/filters/slim.rb +2 -6
  146. data/lib/nanoc/filters/typogruby.rb +0 -4
  147. data/lib/nanoc/filters/uglify_js.rb +0 -2
  148. data/lib/nanoc/filters/xsl.rb +1 -5
  149. data/lib/nanoc/filters/yui_compressor.rb +0 -4
  150. data/lib/nanoc/helpers.rb +0 -2
  151. data/lib/nanoc/helpers/blogging.rb +12 -20
  152. data/lib/nanoc/helpers/breadcrumbs.rb +0 -4
  153. data/lib/nanoc/helpers/capturing.rb +2 -10
  154. data/lib/nanoc/helpers/filtering.rb +0 -4
  155. data/lib/nanoc/helpers/html_escape.rb +3 -7
  156. data/lib/nanoc/helpers/link_to.rb +0 -4
  157. data/lib/nanoc/helpers/rendering.rb +8 -12
  158. data/lib/nanoc/helpers/tagging.rb +0 -4
  159. data/lib/nanoc/helpers/text.rb +1 -5
  160. data/lib/nanoc/helpers/xml_sitemap.rb +3 -7
  161. data/lib/nanoc/tasks/clean.rb +1 -7
  162. data/lib/nanoc/tasks/deploy/rsync.rake +0 -2
  163. data/lib/nanoc/tasks/validate.rake +0 -4
  164. data/lib/nanoc/version.rb +1 -3
  165. data/nanoc.gemspec +12 -9
  166. data/tasks/rubocop.rake +1 -1
  167. data/tasks/test.rake +6 -7
  168. data/test/base/checksummer_spec.rb +28 -44
  169. data/test/base/core_ext/array_spec.rb +1 -9
  170. data/test/base/core_ext/hash_spec.rb +7 -19
  171. data/test/base/core_ext/pathname_spec.rb +2 -4
  172. data/test/base/core_ext/string_spec.rb +0 -4
  173. data/test/base/temp_filename_factory_spec.rb +0 -8
  174. data/test/base/test_checksum_store.rb +0 -2
  175. data/test/base/test_code_snippet.rb +0 -2
  176. data/test/base/test_compiler.rb +15 -17
  177. data/test/base/test_compiler_dsl.rb +7 -9
  178. data/test/base/test_context.rb +2 -4
  179. data/test/base/test_data_source.rb +0 -2
  180. data/test/base/test_dependency_tracker.rb +0 -2
  181. data/test/base/test_directed_graph.rb +2 -4
  182. data/test/base/test_filter.rb +5 -7
  183. data/test/base/test_item.rb +17 -13
  184. data/test/base/test_item_array.rb +2 -4
  185. data/test/base/test_item_rep.rb +79 -73
  186. data/test/base/test_layout.rb +3 -5
  187. data/test/base/test_memoization.rb +13 -21
  188. data/test/base/test_notification_center.rb +0 -2
  189. data/test/base/test_outdatedness_checker.rb +34 -36
  190. data/test/base/test_plugin.rb +0 -2
  191. data/test/base/test_rule.rb +3 -5
  192. data/test/base/test_rule_context.rb +4 -6
  193. data/test/base/test_site.rb +9 -17
  194. data/test/base/test_store.rb +2 -6
  195. data/test/cli/commands/test_check.rb +1 -3
  196. data/test/cli/commands/test_compile.rb +24 -15
  197. data/test/cli/commands/test_create_item.rb +1 -3
  198. data/test/cli/commands/test_create_layout.rb +0 -2
  199. data/test/cli/commands/test_create_site.rb +0 -3
  200. data/test/cli/commands/test_deploy.rb +9 -11
  201. data/test/cli/commands/test_help.rb +0 -2
  202. data/test/cli/commands/test_info.rb +0 -2
  203. data/test/cli/commands/test_prune.rb +6 -8
  204. data/test/cli/commands/test_sync.rb +0 -2
  205. data/test/cli/commands/test_update.rb +0 -2
  206. data/test/cli/commands/test_watch.rb +4 -6
  207. data/test/cli/test_cleaning_stream.rb +4 -6
  208. data/test/cli/test_cli.rb +9 -5
  209. data/test/cli/test_error_handler.rb +9 -7
  210. data/test/cli/test_logger.rb +0 -2
  211. data/test/data_sources/test_filesystem.rb +8 -10
  212. data/test/data_sources/test_filesystem_unified.rb +35 -34
  213. data/test/data_sources/test_filesystem_verbose.rb +31 -33
  214. data/test/data_sources/test_static.rb +20 -21
  215. data/test/extra/checking/checks/test_css.rb +23 -2
  216. data/test/extra/checking/checks/test_external_links.rb +2 -4
  217. data/test/extra/checking/checks/test_html.rb +4 -3
  218. data/test/extra/checking/checks/test_internal_links.rb +1 -3
  219. data/test/extra/checking/checks/test_stale.rb +4 -6
  220. data/test/extra/checking/test_check.rb +0 -2
  221. data/test/extra/checking/test_dsl.rb +1 -3
  222. data/test/extra/checking/test_runner.rb +0 -2
  223. data/test/extra/core_ext/test_pathname.rb +0 -3
  224. data/test/extra/core_ext/test_time.rb +0 -2
  225. data/test/extra/deployers/test_fog.rb +13 -15
  226. data/test/extra/deployers/test_rsync.rb +4 -6
  227. data/test/extra/test_auto_compiler.rb +47 -25
  228. data/test/extra/test_file_proxy.rb +1 -3
  229. data/test/extra/test_filesystem_tools.rb +47 -7
  230. data/test/extra/test_link_collector.rb +0 -2
  231. data/test/extra/test_piper.rb +3 -5
  232. data/test/extra/test_vcs.rb +0 -2
  233. data/test/extra/validators/test_links.rb +0 -1
  234. data/test/extra/validators/test_w3c.rb +2 -4
  235. data/test/filters/test_asciidoc.rb +0 -2
  236. data/test/filters/test_bluecloth.rb +0 -2
  237. data/test/filters/test_coderay.rb +2 -4
  238. data/test/filters/test_coffeescript.rb +0 -2
  239. data/test/filters/test_colorize_syntax.rb +16 -18
  240. data/test/filters/test_erb.rb +12 -14
  241. data/test/filters/test_erubis.rb +4 -6
  242. data/test/filters/test_haml.rb +7 -9
  243. data/test/filters/test_handlebars.rb +10 -12
  244. data/test/filters/test_kramdown.rb +13 -1
  245. data/test/filters/test_less.rb +9 -11
  246. data/test/filters/test_markaby.rb +0 -2
  247. data/test/filters/test_maruku.rb +0 -2
  248. data/test/filters/test_mustache.rb +4 -6
  249. data/test/filters/test_pandoc.rb +1 -3
  250. data/test/filters/test_rainpress.rb +1 -3
  251. data/test/filters/test_rdiscount.rb +1 -3
  252. data/test/filters/test_rdoc.rb +0 -2
  253. data/test/filters/test_redcarpet.rb +6 -8
  254. data/test/filters/test_redcloth.rb +1 -3
  255. data/test/filters/test_relativize_paths.rb +29 -34
  256. data/test/filters/test_rubypants.rb +0 -2
  257. data/test/filters/test_sass.rb +8 -10
  258. data/test/filters/test_slim.rb +2 -4
  259. data/test/filters/test_typogruby.rb +0 -3
  260. data/test/filters/test_uglify_js.rb +2 -4
  261. data/test/filters/test_xsl.rb +16 -18
  262. data/test/filters/test_yui_compressor.rb +3 -5
  263. data/test/fixtures/vcr_cassettes/css_run_parse_error.yml +65 -0
  264. data/test/gem_loader.rb +1 -1
  265. data/test/helper.rb +11 -15
  266. data/test/helpers/test_blogging.rb +61 -63
  267. data/test/helpers/test_breadcrumbs.rb +0 -2
  268. data/test/helpers/test_capturing.rb +4 -6
  269. data/test/helpers/test_filtering.rb +2 -4
  270. data/test/helpers/test_html_escape.rb +0 -2
  271. data/test/helpers/test_link_to.rb +5 -6
  272. data/test/helpers/test_rendering.rb +2 -4
  273. data/test/helpers/test_tagging.rb +9 -11
  274. data/test/helpers/test_text.rb +6 -8
  275. data/test/helpers/test_xml_sitemap.rb +11 -13
  276. data/test/tasks/test_clean.rb +0 -2
  277. data/test/test_gem.rb +1 -3
  278. metadata +15 -14
  279. data/Gemfile.lock +0 -252
  280. data/lib/nanoc/base/core_ext/date.rb +0 -29
  281. data/lib/nanoc/base/ordered_hash.rb +0 -228
  282. data/lib/nanoc/extra/core_ext/enumerable.rb +0 -33
  283. data/test/base/core_ext/date_spec.rb +0 -15
  284. data/test/extra/core_ext/test_enumerable.rb +0 -28
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class Maruku < Nanoc::Filter
5
-
6
5
  requires 'maruku'
7
6
 
8
7
  # Runs the content through [Maruku](https://github.com/bhollis/maruku/).
@@ -15,6 +14,5 @@ module Nanoc::Filters
15
14
  # Get result
16
15
  ::Maruku.new(content, params).to_html
17
16
  end
18
-
19
17
  end
20
18
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.2.0
6
5
  class Mustache < Nanoc::Filter
7
-
8
6
  requires 'mustache'
9
7
 
10
8
  # Runs the content through
@@ -15,10 +13,8 @@ module Nanoc::Filters
15
13
  #
16
14
  # @return [String] The filtered content
17
15
  def run(content, _params = {})
18
- context = item.attributes.merge({ :yield => assigns[:content] })
16
+ context = item.attributes.merge({ yield: assigns[:content] })
19
17
  ::Mustache.render(content, context)
20
18
  end
21
-
22
19
  end
23
-
24
20
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class Pandoc < Nanoc::Filter
5
-
6
5
  requires 'pandoc-ruby'
7
6
 
8
7
  # Runs the content through [Pandoc](http://johnmacfarlane.net/pandoc/)
@@ -15,6 +14,5 @@ module Nanoc::Filters
15
14
  def run(content, *params)
16
15
  PandocRuby.convert(content, *params)
17
16
  end
18
-
19
17
  end
20
18
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class Rainpress < Nanoc::Filter
5
-
6
5
  requires 'rainpress'
7
6
 
8
7
  # Runs the content through [Rainpress](http://code.google.com/p/rainpress/).
@@ -14,6 +13,5 @@ module Nanoc::Filters
14
13
  def run(content, params = {})
15
14
  ::Rainpress.compress(content, params)
16
15
  end
17
-
18
16
  end
19
17
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class RDiscount < Nanoc::Filter
5
-
6
5
  requires 'rdiscount'
7
6
 
8
7
  # Runs the content through [RDiscount](http://github.com/rtomayko/rdiscount).
@@ -17,6 +16,5 @@ module Nanoc::Filters
17
16
 
18
17
  ::RDiscount.new(content, *extensions).to_html
19
18
  end
20
-
21
19
  end
22
20
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class RDoc < Nanoc::Filter
5
-
6
5
  requires 'rdoc'
7
6
 
8
7
  def self.setup
@@ -21,6 +20,5 @@ module Nanoc::Filters
21
20
  to_html = ::RDoc::Markup::ToHtml.new(options)
22
21
  ::RDoc::Markup.new.convert(content, to_html)
23
22
  end
24
-
25
23
  end
26
24
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.2.0
6
5
  class Redcarpet < Nanoc::Filter
7
-
8
6
  requires 'redcarpet'
9
7
 
10
8
  # Runs the content through [Redcarpet](https://github.com/vmg/redcarpet).
@@ -81,7 +79,5 @@ module Nanoc::Filters
81
79
  end
82
80
  end
83
81
  end
84
-
85
82
  end
86
-
87
83
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class RedCloth < Nanoc::Filter
5
-
6
5
  requires 'redcloth'
7
6
 
8
7
  # Runs the content through [RedCloth](http://redcloth.org/). This method
@@ -42,6 +41,5 @@ module Nanoc::Filters
42
41
  # Get result
43
42
  r.to_html
44
43
  end
45
-
46
44
  end
47
45
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class RelativizePaths < Nanoc::Filter
5
-
6
5
  require 'nanoc/helpers/link_to'
7
6
  include Nanoc::Helpers::LinkTo
8
7
 
@@ -37,7 +36,7 @@ module Nanoc::Filters
37
36
  # Filter
38
37
  case params[:type]
39
38
  when :css
40
- # FIXME parse CSS the proper way using csspool or something
39
+ # FIXME: parse CSS the proper way using csspool or something
41
40
  content.gsub(/url\((['"]?)(\/(?:[^\/].*?)?)\1\)/) do
42
41
  'url(' + $1 + relative_path_to($2) + $1 + ')'
43
42
  end
@@ -53,7 +52,7 @@ module Nanoc::Filters
53
52
  klass = ::Nokogiri::XML
54
53
  when :xhtml
55
54
  klass = ::Nokogiri::XML
56
- # FIXME cleanup because it is ugly
55
+ # FIXME: cleanup because it is ugly
57
56
  # this cleans the XHTML namespace to process fragments and full
58
57
  # documents in the same way. At least, Nokogiri adds this namespace
59
58
  # if detects the `html` element.
@@ -98,6 +97,5 @@ module Nanoc::Filters
98
97
  def path_is_relativizable?(s)
99
98
  s[0, 1] == '/'
100
99
  end
101
-
102
100
  end
103
101
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class RubyPants < Nanoc::Filter
5
-
6
5
  requires 'rubypants'
7
6
 
8
7
  # Runs the content through [RubyPants](http://rubydoc.info/gems/rubypants/).
@@ -15,6 +14,5 @@ module Nanoc::Filters
15
14
  # Get result
16
15
  ::RubyPants.new(content).to_html
17
16
  end
18
-
19
17
  end
20
18
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class Sass < Nanoc::Filter
5
-
6
5
  requires 'sass', 'nanoc/filters/sass/sass_filesystem_importer'
7
6
 
8
7
  # Runs the content through [Sass](http://sass-lang.com/).
@@ -13,8 +12,8 @@ module Nanoc::Filters
13
12
  # @return [String] The filtered content
14
13
  def run(content, params = {})
15
14
  options = params.merge({
16
- :nanoc_current_filter => self,
17
- :filename => @item && @item.raw_filename,
15
+ nanoc_current_filter: self,
16
+ filename: @item && @item.raw_filename,
18
17
  })
19
18
  engine = ::Sass::Engine.new(content, options)
20
19
  engine.render
@@ -26,6 +25,5 @@ module Nanoc::Filters
26
25
  Pathname.new(i.raw_filename).realpath == Pathname.new(filename).realpath
27
26
  end
28
27
  end
29
-
30
28
  end
31
29
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  class ::Sass::Importers::Filesystem
4
-
5
4
  alias_method :_orig_find, :_find
6
5
 
7
6
  def _find(dir, name, options)
@@ -17,5 +16,4 @@ class ::Sass::Importers::Filesystem
17
16
  # Call original _find
18
17
  _orig_find(dir, name, options)
19
18
  end
20
-
21
19
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.2.0
6
5
  class Slim < Nanoc::Filter
7
-
8
6
  requires 'slim'
9
7
 
10
8
  # Runs the content through [Slim](http://slim-lang.com/).
@@ -15,8 +13,8 @@ module Nanoc::Filters
15
13
  # @return [String] The filtered content
16
14
  def run(content, params = {})
17
15
  params = {
18
- :disable_capture => true, # Capture managed by nanoc
19
- :buffer => '_erbout', # Force slim to output to the buffer used by nanoc
16
+ disable_capture: true, # Capture managed by nanoc
17
+ buffer: '_erbout', # Force slim to output to the buffer used by nanoc
20
18
  }.merge params
21
19
 
22
20
  # Create context
@@ -24,7 +22,5 @@ module Nanoc::Filters
24
22
 
25
23
  ::Slim::Template.new(params) { content }.render(context) { assigns[:content] }
26
24
  end
27
-
28
25
  end
29
-
30
26
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.2.0
6
5
  class Typogruby < Nanoc::Filter
7
-
8
6
  requires 'typogruby'
9
7
 
10
8
  # Runs the content through [Typogruby](http://avdgaag.github.com/typogruby/).
@@ -17,7 +15,5 @@ module Nanoc::Filters
17
15
  # Get result
18
16
  ::Typogruby.improve(content)
19
17
  end
20
-
21
18
  end
22
-
23
19
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Nanoc::Filters
4
4
  class UglifyJS < Nanoc::Filter
5
-
6
5
  requires 'uglifier'
7
6
 
8
7
  # Runs the content through [UglifyJS](https://github.com/mishoo/UglifyJS2/).
@@ -17,6 +16,5 @@ module Nanoc::Filters
17
16
  # Add filename to load path
18
17
  Uglifier.new(params).compile(content)
19
18
  end
20
-
21
19
  end
22
20
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.3.0
6
5
  class XSL < Nanoc::Filter
7
-
8
6
  requires 'nokogiri'
9
7
 
10
8
  # Runs the item content through an [XSLT](http://www.w3.org/TR/xslt)
@@ -25,7 +23,7 @@ module Nanoc::Filters
25
23
  #
26
24
  # layout 'xsl-report', :xsl, :awesome => 'definitely'
27
25
  #
28
- # @param [String] content Ignored. As the filter can be run only as a
26
+ # @param [String] _content Ignored. As the filter can be run only as a
29
27
  # layout, the value of the `:content` parameter passed to the class at
30
28
  # initialization is used as the content to transform.
31
29
  #
@@ -45,7 +43,5 @@ module Nanoc::Filters
45
43
 
46
44
  xsl.apply_to(xml, ::Nokogiri::XSLT.quote_params(params))
47
45
  end
48
-
49
46
  end
50
-
51
47
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Filters
4
-
5
4
  # @since 3.3.0
6
5
  class YUICompressor < Nanoc::Filter
7
-
8
6
  requires 'yuicompressor'
9
7
 
10
8
  # Compress Javascript or CSS using [YUICompressor](http://rubydoc.info/gems/yuicompressor).
@@ -19,7 +17,5 @@ module Nanoc::Filters
19
17
  def run(content, params = {})
20
18
  ::YUICompressor.compress(content, params)
21
19
  end
22
-
23
20
  end
24
-
25
21
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Helpers
4
-
5
4
  autoload 'Blogging', 'nanoc/helpers/blogging'
6
5
  autoload 'Breadcrumbs', 'nanoc/helpers/breadcrumbs'
7
6
  autoload 'Capturing', 'nanoc/helpers/capturing'
@@ -12,5 +11,4 @@ module Nanoc::Helpers
12
11
  autoload 'Tagging', 'nanoc/helpers/tagging'
13
12
  autoload 'Text', 'nanoc/helpers/text'
14
13
  autoload 'XMLSitemap', 'nanoc/helpers/xml_sitemap'
15
-
16
14
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Nanoc::Helpers
4
-
5
4
  # Provides functionality for building blogs, such as finding articles and
6
5
  # constructing feeds.
7
6
  #
@@ -22,13 +21,12 @@ module Nanoc::Helpers
22
21
  #
23
22
  # The two main functions are {#sorted_articles} and {#atom_feed}.
24
23
  module Blogging
25
-
26
24
  # Returns an unsorted list of articles, i.e. items where the `kind`
27
25
  # attribute is set to `"article"`.
28
26
  #
29
27
  # @return [Array] An array containing all articles
30
28
  def articles
31
- blk = lambda { @items.select { |item| item[:kind] == 'article' } }
29
+ blk = -> { @items.select { |item| item[:kind] == 'article' } }
32
30
  if @items.frozen?
33
31
  @article_items ||= blk.call
34
32
  else
@@ -42,9 +40,7 @@ module Nanoc::Helpers
42
40
  #
43
41
  # @return [Array] A sorted array containing all articles
44
42
  def sorted_articles
45
- blk = lambda do
46
- articles.sort_by { |a| attribute_to_time(a[:created_at]) }.reverse
47
- end
43
+ blk = -> { articles.sort_by { |a| attribute_to_time(a[:created_at]) }.reverse }
48
44
 
49
45
  if @items.frozen?
50
46
  @sorted_article_items ||= blk.call
@@ -54,7 +50,6 @@ module Nanoc::Helpers
54
50
  end
55
51
 
56
52
  class AtomFeedBuilder
57
-
58
53
  include Nanoc::Helpers::Blogging
59
54
 
60
55
  attr_accessor :site
@@ -82,7 +77,7 @@ module Nanoc::Helpers
82
77
 
83
78
  def build
84
79
  buffer = ''
85
- xml = Builder::XmlMarkup.new(:target => buffer, :indent => 2)
80
+ xml = Builder::XmlMarkup.new(target: buffer, indent: 2)
86
81
  build_for_feed(xml)
87
82
  buffer
88
83
  end
@@ -128,7 +123,7 @@ module Nanoc::Helpers
128
123
 
129
124
  def build_for_feed(xml)
130
125
  xml.instruct!
131
- xml.feed(:xmlns => 'http://www.w3.org/2005/Atom') do
126
+ xml.feed(xmlns: 'http://www.w3.org/2005/Atom') do
132
127
  root_url = @site.config[:base_url] + '/'
133
128
 
134
129
  # Add primary attributes
@@ -139,8 +134,8 @@ module Nanoc::Helpers
139
134
  xml.updated(attribute_to_time(last_article[:created_at]).to_iso8601_time)
140
135
 
141
136
  # Add links
142
- xml.link(:rel => 'alternate', :href => root_url)
143
- xml.link(:rel => 'self', :href => feed_url)
137
+ xml.link(rel: 'alternate', href: root_url)
138
+ xml.link(rel: 'self', href: feed_url)
144
139
 
145
140
  # Add author information
146
141
  xml.author do
@@ -167,7 +162,7 @@ module Nanoc::Helpers
167
162
  xml.entry do
168
163
  # Add primary attributes
169
164
  xml.id atom_tag_for(a)
170
- xml.title a[:title], :type => 'html'
165
+ xml.title a[:title], type: 'html'
171
166
 
172
167
  # Add dates
173
168
  xml.published attribute_to_time(a[:created_at]).to_iso8601_time
@@ -182,15 +177,14 @@ module Nanoc::Helpers
182
177
  end
183
178
 
184
179
  # Add link
185
- xml.link(:rel => 'alternate', :href => url)
180
+ xml.link(rel: 'alternate', href: url)
186
181
 
187
182
  # Add content
188
183
  summary = excerpt_proc.call(a)
189
- xml.content content_proc.call(a), :type => 'html'
190
- xml.summary summary, :type => 'html' unless summary.nil?
184
+ xml.content content_proc.call(a), type: 'html'
185
+ xml.summary summary, type: 'html' unless summary.nil?
191
186
  end
192
187
  end
193
-
194
188
  end
195
189
 
196
190
  # Returns a string representing the atom feed containing recent articles,
@@ -309,8 +303,8 @@ module Nanoc::Helpers
309
303
  # Fill builder
310
304
  builder.limit = params[:limit] || 5
311
305
  builder.relevant_articles = params[:articles] || articles || []
312
- builder.content_proc = params[:content_proc] || lambda { |a| a.compiled_content(:snapshot => :pre) }
313
- builder.excerpt_proc = params[:excerpt_proc] || lambda { |a| a[:excerpt] }
306
+ builder.content_proc = params[:content_proc] || ->(a) { a.compiled_content(snapshot: :pre) }
307
+ builder.excerpt_proc = params[:excerpt_proc] || ->(a) { a[:excerpt] }
314
308
  builder.title = params[:title] || @item[:title] || @site.config[:title]
315
309
  builder.author_name = params[:author_name] || @item[:author_name] || @site.config[:author_name]
316
310
  builder.author_uri = params[:author_uri] || @item[:author_uri] || @site.config[:author_uri]
@@ -386,7 +380,5 @@ module Nanoc::Helpers
386
380
  time = Time.parse(time) if time.is_a?(String)
387
381
  time
388
382
  end
389
-
390
383
  end
391
-
392
384
  end