lib/nanoc/base/compilation/rule_context.rb in nanoc-3.7.4 vs lib/nanoc/base/compilation/rule_context.rb in nanoc-3.7.5

- old
+ new

@@ -1,9 +1,8 @@ # encoding: utf-8 module Nanoc - # Provides a context in which compilation and routing rules can be executed. # It provides access to the item representation that is being compiled or # routed. # # The following variables will be available in this rules context: @@ -15,11 +14,10 @@ # * `items` ({Array}<{Nanoc::Item}>) - A list of all items # * `layouts` ({Array}<{Nanoc::Layout}>) - A list of all layouts # # @api private class RuleContext < Context - # @option params [Nanoc::ItemRep] :rep The item representation that will # be processed in this rule context # # @option params [Nanoc::Compiler] :compiler The compiler that is being # used to compile the site @@ -33,17 +31,17 @@ compiler = params.fetch(:compiler) do raise ArgumentError, 'Required :compiler option is missing' end super({ - :rep => rep, - :item_rep => rep, - :item => rep.item, - :site => compiler.site, - :config => compiler.site.config, - :items => compiler.site.items, - :layouts => compiler.site.layouts + rep: rep, + item_rep: rep, + item: rep.item, + site: compiler.site, + config: compiler.site.config, + items: compiler.site.items, + layouts: compiler.site.layouts }) end # Filters the current representation (calls {Nanoc::ItemRep#filter} with # the given arguments on the rep). @@ -83,9 +81,7 @@ # # @return [void] def snapshot(snapshot_name) rep.snapshot(snapshot_name) end - end - end