class Rouge::Lexers::Gherkin
def self.detect?(text)
def self.detect?(text) return true if text.shebang? 'cucumber' end
def self.keywords
def self.keywords load File.join(__dir__, 'gherkin/keywords.rb') keywords end
def self.step_regex
def self.step_regex # in Gherkin's config, keywords that end in < don't # need word boundaries at the ends - all others do. @step_regex ||= Regexp.new( keywords[:step].map do |w| if w.end_with? '<' Regexp.escape(w.chop) else "#{Regexp.escape(w)}\\b" end end.join('|') ) end