mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/locale.rb (IRB::Locale#initialize)
initializes instance variables to suppress warnings. typo fix to ignore LoadError: [ruby-dev:37508] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63219d8a24
commit
734e1dc491
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Dec 20 10:59:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* lib/irb/locale.rb (IRB::Locale#initialize)
|
||||
initializes instance variables to suppress warnings.
|
||||
typo fix to ignore LoadError: [ruby-dev:37508]
|
||||
|
||||
Fri Dec 19 17:01:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_extract_encoding_option): "internal_encoding: nil"
|
||||
|
|
|
@ -29,12 +29,13 @@ module IRB
|
|||
@@legacy_encoding_alias_map = {}.freeze
|
||||
|
||||
def initialize(locale = nil)
|
||||
@lang = @territory = @encoding_name = @modifier = nil
|
||||
@locale = locale || ENV["IRB_LANG"] || ENV["LC_MESSAGES"] || ENV["LC_ALL"] || ENV["LANG"] || "C"
|
||||
if m = LOCALE_NAME_RE.match(@locale)
|
||||
@lang, @territory, @encoding_name, @modifier = m[:language], m[:territory], m[:codeset], m[:modifier]
|
||||
|
||||
if @encoding_name
|
||||
begin; load 'irb/encoding_aliases.rb' rescue LoadError; end
|
||||
begin load 'irb/encoding_aliases.rb'; rescue LoadError; end
|
||||
if @encoding = @@legacy_encoding_alias_map[@encoding_name]
|
||||
warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue