lib/foreman/export/base.rb in foreman-0.4.7 vs lib/foreman/export/base.rb in foreman-0.5.0

- old
+ new

@@ -34,9 +34,15 @@ hash.update(process => amount.to_i) end end end + def port_for(base_port, app, num) + base_port ||= 5000 + offset = engine.processes.keys.sort.index(app) * 100 + base_port.to_i + offset + num - 1 + end + def write_file(filename, contents) say "writing: #{filename}" File.open(filename, "w") do |file| file.puts contents