vendor/bundle/ruby/1.8/gems/gherkin-2.9.0/lib/gherkin/i18n.rb
def keyword_regexp(*keywords)
        unique_keywords = all.map do |i18n|
          keywords.map do |keyword|
            if keyword.to_s == 'step'
              i18n.step_keywords.to_a
            else
              i18n.keywords(keyword).to_a
            end
          end
        end
        
        unique_keywords.flatten.compact.map{|kw| kw.to_s}.sort.reverse.uniq.join('|').gsub(/\*/, '\*')
      end
# Returns all keyword translations and aliases of +keywords+, escaped and joined with <tt>|</tt>.
# This method is convenient for editor support and syntax highlighting engines for Gherkin, where
# there is typically a code generation tool to generate regular expressions for recognising the
# various I18n translations of Gherkin's keywords.
#
# The +keywords+ arguments can be one of <tt>:feature</tt>, <tt>:background</tt>, <tt>:scenario</tt>, 
# <tt>:scenario_outline</tt>, <tt>:examples</tt>, <tt>:step</tt>.
Returns all keyword translations and aliases of +keywords+, escaped and joined with |.
This method is convenient for editor support and syntax highlighting engines for Gherkin, where
there is typically a code generation tool to generate regular expressions for recognising the
various I18n translations of Gherkin's keywords.


Returns all keyword translations and aliases of + keywords + escaped and joined with | . This method is convenient for editor support and syntax highlighting engines for Gherkin where there is typically a code generation tool to generate regular expressions for recognising the various I18n translations of Gherkin ' s keywords .
def keyword_regexp(*keywords)
        unique_keywords = all.map do |i18n|
          keywords.map do |keyword|
            if keyword.to_s == 'step'
              i18n.step_keywords.to_a
            else
              i18n.keywords(keyword).to_a
            end
          end
        end
        unique_keywords.flatten.compact.map{|kw| kw.to_s}.sort.reverse.uniq.join('|').gsub(/\*/, '\*')
      end
def keyword_regexp ( * keywords ) unique_keywords = all . map do | i18n | keywords . map do | keyword | if keyword . to_s == 'step' i18n . step_keywords . to_a else i18n . keywords ( keyword ) . to_a end end end unique_keywords . flatten . compact . map { | kw | kw . to_s } . sort . reverse . uniq . join ( '|' ) . gsub ( / \* / , '\*' ) end
Returns all keyword translations and aliases of +keywords+, escaped and joined with <tt>|</tt>.
Returns all keyword translations and aliases of + keywords + escaped and joined with <tt > |< / tt > .
keywords