lib/nanoc/base/entities/action_sequence.rb in nanoc-4.7.5 vs lib/nanoc/base/entities/action_sequence.rb in nanoc-4.7.6
- old
+ new
@@ -1,10 +1,13 @@
module Nanoc::Int
class ActionSequence
include Nanoc::Int::ContractsSupport
include Enumerable
+ attr_reader :item_rep
+ attr_reader :actions
+
def initialize(item_rep, actions: [])
@item_rep = item_rep
@actions = actions
end
@@ -67,21 +70,9 @@
def map
self.class.new(
@item_rep,
actions: @actions.map { |a| yield(a) },
)
- end
-
- def compact_snapshots
- actions = []
- @actions.each do |action|
- if [actions.last, action].all? { |a| a.is_a?(Nanoc::Int::ProcessingActions::Snapshot) }
- actions[-1] = actions.last.update(snapshot_names: action.snapshot_names, paths: action.paths)
- else
- actions << action
- end
- end
- self.class.new(@item_rep, actions: actions)
end
def snapshots_defs
is_binary = @item_rep.item.content.binary?
snapshot_defs = []