From a435fae7bd5e51b22757d1e2a0ef1240e75b4761 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 Mar 2016 15:07:05 +0000 Subject: [PATCH] logger.rb: kwd args * lib/logger.rb (Logger::LogDevice#initialize): define using keyword arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/logger.rb | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a9d305339..f1dd0aec1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 9 00:07:03 2016 Nobuyoshi Nakada + + * lib/logger.rb (Logger::LogDevice#initialize): define using + keyword arguments. + Tue Mar 8 23:37:07 2016 Charles Oliver Nutter * test/ruby/test_array.rb: split out the test for no stack error diff --git a/lib/logger.rb b/lib/logger.rb index 5a310bacb5..8393806a11 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -629,13 +629,13 @@ private 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