English.rb

cgi.rbを読んでたら「require 'English'」というのがあって「???」と思ってたら、cgi.rbのすぐそばにEnglish.rbがあった。

#  Include the English library file in a Ruby script, and you can
#  reference the global variables such as \VAR{\$\_} using less
#  cryptic names, listed in the following table.% \vref{tab:english}.
#
#  Without 'English':
#
#      $\ = ' -- '
#      "waterbuffalo" =~ /buff/
#      print $", $', $$, "\n"
#
#  With English:
#
#      require "English"
#      
#      $OUTPUT_FIELD_SEPARATOR = ' -- '
#      "waterbuffalo" =~ /buff/
#      print $LOADED_FEATURES, $POSTMATCH, $PID, "\n"

記号的な変数に英語のエイリアスをつけて、読みやすくしようというものらしい。便利かどうかはビミョーな気がするけど、「English」ってすげぇ名前だなぁ。


追記
aliasってこーゆー使い方もできるのかー。

# The exception object passed to +raise+.
alias $ERROR_INFO              $!