lib/hx/backend/rawfiles.rb in hx-0.12.0 vs lib/hx/backend/rawfiles.rb in hx-0.13.0
- old
+ new
@@ -30,10 +30,12 @@
class RawFiles
include Hx::Filter
def initialize(input, options)
@entry_dir = Hx.get_pathname(options, :entry_dir)
+ @post_edit = options[:post_edit]
+ @post_edit = @post_edit.split(/\s+/) if @post_edit
end
def path_to_pathname(path) ; @entry_dir + path ; end
private :path_to_pathname
@@ -50,9 +52,10 @@
raise NoSuchEntryError, path unless prototype
text = prototype['content'].to_s
end
text = yield text
Hx.write_file(pathname, text)
+ system *(@post_edit + [pathname]) if @post_edit
self
end
def each_entry_path(selector)
Pathname.glob(@entry_dir + '**/*') do |pathname|