[前][次][番号順一覧][スレッド一覧]

ruby-changes:9350

From: yugui <ko1@a...>
Date: Sat, 20 Dec 2008 11:01:47 +0900 (JST)
Subject: [ruby-changes:9350] Ruby:r20887 (trunk): * lib/irb/locale.rb (IRB::Locale#initialize)

yugui	2008-12-20 11:01:26 +0900 (Sat, 20 Dec 2008)

  New Revision: 20887

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20887

  Log:
    * lib/irb/locale.rb (IRB::Locale#initialize)
      initializes instance variables to suppress warnings.
      typo fix to ignore LoadError: [ruby-dev:37508]

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/locale.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20886)
+++ ChangeLog	(revision 20887)
@@ -1,3 +1,9 @@
+Sat Dec 20 10:59:16 2008  Yuki Sonoda (Yugui)  <yugui@y...>
+
+	* 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@r...>
 
 	* io.c (rb_io_extract_encoding_option): "internal_encoding: nil"
Index: lib/irb/locale.rb
===================================================================
--- lib/irb/locale.rb	(revision 20886)
+++ lib/irb/locale.rb	(revision 20887)
@@ -29,12 +29,13 @@
     @@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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]