Sha256: 86becd5fd9b4bf54f7c7a170f571a6cd292c4bef66d1e924e07047191d2fc483

Contents?: true

Size: 270 Bytes

Versions: 1

Compression:

Stored size: 270 Bytes

Contents

module Codependency
  class Parser

    def parse( file )
      IO.readlines( file ).take_while do |line|
        line =~ pattern
      end.map { |line| line[ pattern, 1 ] }
    end

    protected

    def pattern
      @pattern ||= /^# require (.+)$/
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codependency-0.1.0 lib/codependency/parser.rb