48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/pr2gpx/parser.rb', line 48
def parse input
Enumerator.new do |e|
if %r{
(X-From:[ ](?<callsign>[^\n]*))\n
.*
(TIME:[ ](?<year>\d+)/(?<month>\d+)/(?<day>\d+)[ ](?<hour>\d+):(?<minute>\d+))\n
(LATITUDE:[ ](?<latitude>[^\n]*))\n
(LONGITUDE:[ ](?<longitude>[^\n]*))\n
(COMMENT:[ ](?<comment>[^\n]*))}xm =~ input
then
e.yield PositionReport.new callsign,
DateTime.new(year.to_i, month.to_i, day.to_i, hour.to_i, minute.to_i, 0),
Position.new(latitude, longitude),
end
end
end
|