implemented flog backend
[augment.git] / lib / backends / backend.rb
blob95c6c5b789aeb47c26ccdf3ebecf75cb9d895c69
1 require 'fileutils'
3 class Backend
4   class << self
5     def write_layers
6       @layers.each do |file, layers|
7         FileUtils.mkpath(File.dirname(file) + '/.augment')
8         File.open(Augment.augment_path(file), 'w') do |f|
9           f.puts "[#{layers.map{ |l| l.to_json }.join(", \n")}]"
10         end
11       end
12     end
14     def with_no_output
15       old_stdout = $stdout.clone
16       $stdout.reopen(File.new('/dev/null','w'))
17       yield
18       $stdout.reopen(old_stdout)
19     end
20   end
21 end