lib/nanoc/base/compilation/rules_collection.rb in nanoc-3.7.4 vs lib/nanoc/base/compilation/rules_collection.rb in nanoc-3.7.5
- old
+ new
@@ -1,14 +1,12 @@
# encoding: utf-8
module Nanoc
-
# Keeps track of the rules in a site.
#
# @api private
class RulesCollection
-
# @return [String] the contents of the Rules file
#
# @api private
attr_accessor :data
@@ -39,12 +37,12 @@
def initialize(compiler)
@compiler = compiler
@item_compilation_rules = []
@item_routing_rules = []
- @layout_filter_mapping = OrderedHash.new
- @preprocessors = OrderedHash.new
+ @layout_filter_mapping = {}
+ @preprocessors = {}
end
# Add the given rule to the list of item compilation rules.
#
# @param [Nanoc::Rule] rule The item compilation rule to add
@@ -99,12 +97,12 @@
#
# @return [void]
def unload
@item_compilation_rules = []
@item_routing_rules = []
- @layout_filter_mapping = OrderedHash.new
- @preprocessors = OrderedHash.new
+ @layout_filter_mapping = {}
+ @preprocessors = {}
end
# Finds the first matching compilation rule for the given item
# representation.
#
@@ -190,11 +188,11 @@
# memory for
#
# @return [Array] The rule memory for the given item representation
def new_rule_memory_for_rep(rep)
recording_proxy = rep.to_recording_proxy
- compilation_rule_for(rep).apply_to(recording_proxy, :compiler => @compiler)
+ compilation_rule_for(rep).apply_to(recording_proxy, compiler: @compiler)
recording_proxy.rule_memory << [:write, rep.path]
make_rule_memory_serializable(recording_proxy.rule_memory)
end
memoize :new_rule_memory_for_rep
@@ -251,9 +249,7 @@
# @return [Nanoc::RuleMemoryCalculator] The rule memory calculator
def rule_memory_calculator
@compiler.rule_memory_calculator
end
-
end
-
end