1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2016-03-08 15:07:05 +00:00
parent 4c0e360dd9
commit a435fae7bd
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Mar 9 00:07:03 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/logger.rb (Logger::LogDevice#initialize): define using
keyword arguments.
Tue Mar 8 23:37:07 2016 Charles Oliver Nutter <headius@headius.com>
* test/ruby/test_array.rb: split out the test for no stack error

View file

@ -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