class Rouge::Lexers::Gherkin

def self.analyze_text(text)

def self.analyze_text(text)
  return 1 if text.shebang? 'cucumber'
end

def self.keywords

self-modifying method that loads the keywords file
def self.keywords
  load Pathname.new(__FILE__).dirname.join('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