1 $LOAD_PATH << File.dirname(__FILE__)
2 $LOAD_PATH << File.dirname(__FILE__) + '/backends'
3 $LOAD_PATH << File.dirname(__FILE__) + '/frontends'
17 def initialize(action, file)
18 raise "No backend or frontend with that name." if action.nil?
24 # Interactive mode allows you to repeatedly give augment a filename and have
25 # it spit back layer JSON immediately. By default only uses the test backend.
27 def interactive(backend_names = 'test')
30 filename = STDIN.gets.chomp
31 backend_names.each { |backend| BACKENDS[backend].run(filename) }
32 puts "{\"#{filename}\" : #{File.read(augment_path(filename))} }"
34 puts "Error augmenting #{filename}."
39 # Where should the JSON layer files be given a file?
40 def augment_path(original)
41 "#{File.dirname(File.expand_path(original))}/.augment/#{File.basename(original)}"
46 # Load up backends and frontends
47 Dir.glob(File.dirname(__FILE__) + '/*ends/*rb').each { |b| require b[0 .. -4] }