cleanup indentation of ruby files

This commit is contained in:
Emil Tin
2013-09-18 08:16:19 +02:00
parent a178555838
commit 6470838065
10 changed files with 40 additions and 45 deletions
+11 -11
View File
@@ -13,18 +13,18 @@ end
def write_server_ini
s=<<-EOF
Threads = 1
IP = 0.0.0.0
Port = #{OSRM_PORT}
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
timestamp=#{@osm_file}.osrm.timestamp
EOF
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
timestamp=#{@osm_file}.osrm.timestamp
EOF
File.open( 'server.ini', 'w') {|f| f.write( s ) }
end
+19 -19
View File
@@ -19,12 +19,12 @@ BIN_PATH = '../build'
DEFAULT_ORIGIN = [1,1]
class Location
attr_accessor :lon,:lat
attr_accessor :lon,:lat
def initialize lon,lat
@lat = lat
@lon = lon
end
def initialize lon,lat
@lat = lat
@lon = lon
end
end
def sanitized_scenario_title
@@ -125,29 +125,29 @@ def build_ways_from_table table
end
def table_coord_to_lonlat ci,ri
[@origin[0]+ci*@zoom, @origin[1]-ri*@zoom]
[@origin[0]+ci*@zoom, @origin[1]-ri*@zoom]
end
def add_osm_node name,lon,lat
node = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, lon, lat
node << { :name => name }
node.uid = OSM_UID
osm_db << node
name_node_hash[name] = node
node = OSM::Node.new make_osm_id, OSM_USER, OSM_TIMESTAMP, lon, lat
node << { :name => name }
node.uid = OSM_UID
osm_db << node
name_node_hash[name] = node
end
def add_location name,lon,lat
location_hash[name] = Location.new(lon,lat)
location_hash[name] = Location.new(lon,lat)
end
def find_node_by_name s
raise "***invalid node name '#{s}', must be single characters" unless s.size == 1
raise "*** invalid node name '#{s}', must be alphanumeric" unless s.match /[a-z0-9]/
if s.match /[a-z]/
from_node = name_node_hash[ s.to_s ]
else
from_node = location_hash[ s.to_s ]
end
raise "***invalid node name '#{s}', must be single characters" unless s.size == 1
raise "*** invalid node name '#{s}', must be alphanumeric" unless s.match /[a-z0-9]/
if s.match /[a-z]/
from_node = name_node_hash[ s.to_s ]
else
from_node = location_hash[ s.to_s ]
end
end
def find_way_by_name s
+1 -1
View File
@@ -1,5 +1,5 @@
class File
#read last n lines of a file. useful for getting last part of a big log file.
def tail(n)
buffer = 1024
-2
View File
@@ -1,4 +1,3 @@
class FuzzyMatch
def self.match got, want
@@ -31,4 +30,3 @@ class FuzzyMatch
end
end
-1
View File
@@ -47,4 +47,3 @@ end
def fingerprint
@fingerprint ||= Digest::SHA1.hexdigest "#{bin_extract_hash}-#{bin_prepare_hash}-#{bin_routed_hash}-#{profile_hash}-#{lua_lib_hash}-#{osm_hash}"
end
+1 -1
View File
@@ -12,7 +12,7 @@ Before do |scenario|
end
Around('@stress') do |scenario, block|
Timeout.timeout(STRESS_TIMEOUT) do
Timeout.timeout(STRESS_TIMEOUT) do
block.call
end
end
-2
View File
@@ -63,5 +63,3 @@ end
def log_preprocess_done
end