* lib/logger.rb (Logger::Period#previous_period_end): as weekly
rotation shifts the log file on Sundays, the end date of the
previous period should be Saturdays. fix r45072.
[ruby-dev:49314] [Bug #11622]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/logger.rb (Logger::Period#next_rotate_time): get rid of
adding to mday not to exceed the days of the month.
[ruby-core:71185] [Bug #11620]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/forwardable.rb (def_instance_delegator, def_single_delegator):
match backtraces against ::Forwardable in case the target class
is a subclass of BasicObject and does not include Kernel.
[ruby-core:71176] [Bug #11616]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rescue ::Exception instead of Exception in case Exception is
defined under the target class.
[ruby-core:71175] [Ruby trunk - Bug #11615]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
when irb.rb loaded. It's affected to IDE such as Jetbrain.
[fix GH-864] Patch by @os97673
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
indentation to avoid a warning when the command line option -w of
ruby is specified.
* lib/matrix/eigenvalue_decomposition.rb (hessenberg_to_real_schur):
change the name of a block parameter to avoid a warning when the
command line option -w of ruby is specified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
a warning when the command line option -w of ruby is specified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Patch by @sferik in [GH-1037]: https://github.com/ruby/ruby/pull/1037
This commit is an addendum to https://github.com/ruby/ruby/pull/1033.
It:
1. lazily defines attribute accessors for copied and marshaled objects,
2. returns nil when an attribute reader is not defined, and
3. defines respond_to_missing? to maintain the same respond_to? behavior
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Version for character normalization data from 7.0.0 to 8.0.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/unicode_norm_gen.tmpl: pragma needs the end marker too,
not only the beginning marker.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
get rid of many .freeze commands by using frozen_string_literal
pragma.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
decimal fractions of a second correctly when the number of digits
is not 6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ostruct.rb (delete_field): do not raise NameError for
existing keys. [Fix GH-1033]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Patch by @sferik in [GH-1033]: https://github.com/ruby/ruby/pull/1033
Instead of defining two methods -- a reader and writer -- for each
OpenStruct attribute when it is initialized, define them lazily, the
first time either one is called. This adheres to the principle of "pay for
use": methods that are never accessed are never defined. This optimization
makes initialization an order of magnitude faster for objects with 100
attributes. In the worst-case scenario, where every attribute is accessed,
performance is no worse than it is today.
Benchmark
---------
require 'benchmark/ips'
require 'ostruct'
N = 100
ATTRS = (:aa..:zz).take(N)
HASH = Hash[ATTRS.map { |x| [x, x] }]
def ostruct
OpenStruct.new(HASH)
end
Benchmark.ips do |x|
x.report('ostruct') { ostruct }
end
-------------------------------------------------
before 2.279k (± 8.8%) i/s - 11.395k
after 24.702k (±12.8%) i/s - 122.600k
-------------------------------------------------
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
media_type, charset): new methods to return standard facts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e