osrm-backend/features/support/config.rb

31 lines
556 B
Ruby
Raw Normal View History

2012-12-16 07:36:47 -05:00
def profile
@profile ||= reset_profile
end
2012-12-16 07:36:47 -05:00
def reset_profile
@profile = nil
set_profile DEFAULT_SPEEDPROFILE
end
2012-12-16 07:36:47 -05:00
def set_profile profile
@profile = profile
end
def write_server_ini
s=<<-EOF
Threads = 1
IP = 0.0.0.0
Port = #{OSRM_PORT}
hsgrData=#{@osm_file}.osrm.hsgr
nodesData=#{@osm_file}.osrm.nodes
edgesData=#{@osm_file}.osrm.edges
ramIndex=#{@osm_file}.osrm.ramIndex
fileIndex=#{@osm_file}.osrm.fileIndex
namesData=#{@osm_file}.osrm.names
2012-12-10 10:07:47 -05:00
timestamp=#{@osm_file}.osrm.timestamp
EOF
File.open( 'server.ini', 'w') {|f| f.write( s ) }
end