presetcategory = ""
# StringIO.open(txt) do |file|
File.open("#{Rails.root}/config/potlatch/presets.txt") do |file|
- file.each_line do|line|
+ file.each_line do |line|
t = line.chomp
if t =~ %r{(\w+)/(\w+)}
presettype = $1
kv = $2
presetnames[presettype][presetcategory].push(pre)
presets[pre] = {}
- kv.split(",").each do|a|
+ kv.split(",").each do |a|
presets[pre][$1] = $2 if a =~ /^(.+)=(.*)$/
end
end
# Read auto-complete
autotags = { "point" => {}, "way" => {}, "POI" => {} }
File.open("#{Rails.root}/config/potlatch/autocomplete.txt") do |file|
- file.each_line do|line|
+ file.each_line do |line|
next unless line.chomp =~ %r{^([\w:]+)/(\w+)\s+(.+)$}
tag = $1