Sha256: c7b148574845b0d9b133a3956735a81d786239892cd2918943553ddb04b05f5d
Contents?: true
Size: 492 Bytes
Versions: 20
Compression:
Stored size: 492 Bytes
Contents
require 'date' begin d = ::Date.today d.freeze d.year needs_patch = false rescue => e needs_patch = true end if needs_patch class ::Date [ :amjd, :jd, :day_fraction, :mjd, :ld, :civil, :ordinal, :commercial, :weeknum0, :weeknum1, :time, :wday, :julian?, :gregorian?, :leap? ].each do |m| module_eval <<EOS alias_method :__orig_#{m}, :#{m} def #{m} self.frozen? ? self.dup.#{m} : self.send(:__orig_#{m}) end EOS end end end
Version data entries
20 entries across 20 versions & 1 rubygems