Sha256: b92ed3d8dfcc8cb375cb7048c30e08fabf064cdf9ea596d87fea407c37df3da1

Contents?: true

Size: 817 Bytes

Versions: 9

Compression:

Stored size: 817 Bytes

Contents

# Part of the Optimus package for managing E-Prime data
# 
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
# 
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
# Imaging and Behavior, University of Wisconsin - Madison

# This almost completely delegates to TabfileParser
# It differs from OptimustabParser only in that it doesn't skip any lines.

require 'tabfile_parser'

module Optimus
  class Reader
    class RawTabParser < TabfileParser
      def initialize(file, options = {})
        options = options.merge(:skip_lines => 0)
        super(file, options)
      end
      
      def self.can_parse?(lines)
        ary = lines.map { |l| l.strip.split("\t") }
        ary[0].size > 1 and ary.all? {|e| e.size == ary[0].size}
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
optimus-ep-0.10.4 lib/raw_tab_parser.rb
optimus-ep-0.10.3 lib/raw_tab_parser.rb
optimus-ep-0.10.2 lib/raw_tab_parser.rb
optimus-ep-0.10.1 lib/raw_tab_parser.rb
optimus-ep-0.10.0 lib/raw_tab_parser.rb
optimus-ep-0.9.1 lib/raw_tab_parser.rb
optimus-ep-0.9.0 lib/raw_tab_parser.rb
optimus-ep-0.8.1 lib/raw_tab_parser.rb
optimus-ep-0.8.0 lib/raw_tab_parser.rb