Sha256: b38f9179f97b28237b96450973e2eea946e8017637ff7628ee94eb6ef911411a
Contents?: true
Size: 535 Bytes
Versions: 14
Compression:
Stored size: 535 Bytes
Contents
require 'gherkin/lexer' module Gherkin # The main entry point to lexing Gherkin source. class I18nLexer LANGUAGE_PATTERN = /language\s*:\s*(.*)/ #:nodoc: def initialize(parser) @parser = parser end def scan(source) lang = lang(source) || 'en' delegate = Lexer[lang].new(@parser) delegate.scan(source) end private def lang(source) line_one = source.split(/\n/)[0] if line_one =~ LANGUAGE_PATTERN $1.strip else nil end end end end
Version data entries
14 entries across 14 versions & 1 rubygems