Class: Tracksperanto::Import::PFTrack
- Defined in:
- lib/import/pftrack.rb
Overview
TODO: this should be rewritten as a proper state-machine parser
Constant Summary collapse
- CHARACTERS_OR_QUOTES =
/[AZaz"]/
- INTS =
/^\d+$/
Instance Attribute Summary
Attributes inherited from Base
#height, #io, #progress_block, #width
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
autodetects_size?, inherited, #report_progress
Methods included from BlockInit
Methods included from ZipTuples
Methods included from ConstName
Methods included from Safety
Methods included from Casts
#cast_to_float, #cast_to_int, #cast_to_string, included
Class Method Details
.distinct_file_ext ⇒ Object
8 9 10 |
# File 'lib/import/pftrack.rb', line 8 def self.distinct_file_ext ".2dt" end |
.human_name ⇒ Object
4 5 6 |
# File 'lib/import/pftrack.rb', line 4 def self.human_name "PFTrack/PFMatchit .2dt file" end |
Instance Method Details
#each ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/import/pftrack.rb', line 15 def each until @io.eof? line = @io.gets next if (!line || line =~ /^#/) if line =~ CHARACTERS_OR_QUOTES # Tracker with a name name = unquote(line.strip) report_progress("Reading tracker #{name}") parse_trackers(name, @io, &Proc.new) end end end |