Module: Gherkin::CLexer

Defined in:
lib/gherkin/c_lexer.rb

Class Method Summary collapse

Class Method Details

.[](i18n_underscored_iso_code) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/gherkin/c_lexer.rb', line 5

def self.[](i18n_underscored_iso_code)
  begin
    prefix = RbConfig::CONFIG['arch'] =~ /mswin|mingw/ ? "#{RbConfig::CONFIG['MAJOR']}.#{RbConfig::CONFIG['MINOR']}/" : ''
    lib = "#{prefix}gherkin_lexer_#{i18n_underscored_iso_code}"
    require lib
    const_get(i18n_underscored_iso_code.capitalize)
  rescue LoadError => e
    e.message << %{\nCouldn't load #{lib}\nThe $LOAD_PATH was:\n#{$LOAD_PATH.join("\n")}}
    raise e
  end
end