# File lib/fastcst/changeset.rb, line 285
285:         def ChangeSet.apply_changeset(journal_in, data_in, target_dir, test_run=false)
286:             begin
287:                 failure_count = 0
288:                 
289:                 YAML.each_document(journal_in) do |op|
290:                     # add one to the failure count unless the operation runs fine
291:                     if test_run
292:                         failure_count += 1 unless op.test(data_in, target_dir)
293:                     else
294:                         failure_count += 1 unless op.run(data_in, target_dir)
295:                     end
296:                 end
297:             ensure
298:                 journal_in.close if journal_in
299:                 data_in.close if data_in
300:             end
301:             
302:             return failure_count
303:         end