lib/nanoc/base/entities/processing_actions/snapshot.rb in nanoc-4.4.5 vs lib/nanoc/base/entities/processing_actions/snapshot.rb in nanoc-4.4.6
- old
+ new
@@ -1,26 +1,28 @@
module Nanoc::Int::ProcessingActions
class Snapshot < Nanoc::Int::ProcessingAction
# snapshot :before_layout
- # snapshot :before_layout, final: true
# snapshot :before_layout, path: '/about.md'
attr_reader :snapshot_name
- attr_reader :final
attr_reader :path
- alias final? final
- def initialize(snapshot_name, final, path)
+ def initialize(snapshot_name, path)
@snapshot_name = snapshot_name
- @final = final
@path = path
end
def serialize
- [:snapshot, @snapshot_name, @final, @path]
+ [:snapshot, @snapshot_name, true, @path]
end
+ NONE = Object.new
+
+ def copy(path: NONE)
+ self.class.new(@snapshot_name, path.equal?(NONE) ? @path : path)
+ end
+
def to_s
- "snapshot #{@snapshot_name.inspect}, final: #{@final.inspect}, path: #{@path.inspect}"
+ "snapshot #{@snapshot_name.inspect}, path: #{@path.inspect}"
end
end
end