Sha256: 0da6d7e105278d4879dc858c107da593120890167b67c52068e44fa06ca68ecd

Contents?: true

Size: 869 Bytes

Versions: 3

Compression:

Stored size: 869 Bytes

Contents

# Part of the Optimus package for managing E-Prime data
# 
# Copyright (C) 2008 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

require 'tabfile_parser'

module Eprime
  class Reader
    class EprimetabParser < TabfileParser
      def initialize(file, options = {})
        options = options.merge(:skip_lines => 3)
        super(file, options)
      end
      
      def self.can_parse?(lines)
        divided = lines.map { |l| l.strip.split("\t") }
        return (
          divided[0].size >= 3 and 
          divided[0].size == divided[1].size and
          divided[0][0] == 'STRING' and
          divided[1][0] == 'EXPNAME'
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
optimus-ep-0.6.5 lib/eprimetab_parser.rb
optimus-ep-0.6.9 lib/eprimetab_parser.rb
optimus-ep-0.6.91 lib/eprimetab_parser.rb