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

ruby-changes:41957

From: nobu <ko1@a...>
Date: Wed, 9 Mar 2016 00:07:09 +0900 (JST)
Subject: [ruby-changes:41957] nobu:r54031 (trunk): logger.rb: kwd args

nobu	2016-03-09 00:07:05 +0900 (Wed, 09 Mar 2016)

  New Revision: 54031

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54031

  Log:
    logger.rb: kwd args
    
    * lib/logger.rb (Logger::LogDevice#initialize): define using
      keyword arguments.

  Modified files:
    trunk/ChangeLog
    trunk/lib/logger.rb
Index: lib/logger.rb
===================================================================
--- lib/logger.rb	(revision 54030)
+++ lib/logger.rb	(revision 54031)
@@ -629,13 +629,13 @@ private https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L629
     attr_reader :filename
     include MonitorMixin
 
-    def initialize(log = nil, opt = {})
+    def initialize(log = nil, shift_age: nil, shift_size: nil)
       @dev = @filename = @shift_age = @shift_size = nil
       mon_initialize
       set_dev(log)
       if @filename
-        @shift_age = opt[:shift_age] || 7
-        @shift_size = opt[:shift_size] || 1048576
+        @shift_age = shift_age || 7
+        @shift_size = shift_size || 1048576
         @next_rotate_time = next_rotate_time(Time.now, @shift_age) unless @shift_age.is_a?(Integer)
       end
     end
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54030)
+++ ChangeLog	(revision 54031)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Mar  9 00:07:03 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/logger.rb (Logger::LogDevice#initialize): define using
+	  keyword arguments.
+
 Tue Mar  8 23:37:07 2016  Charles Oliver Nutter  <headius@h...>
 
 	* test/ruby/test_array.rb: split out the test for no stack error

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

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