Sha256: ec1fb1b0ceb55ae16195d3205d1989c214b0c8d6f51a25f4dfa7ed3953f18607
Contents?: true
Size: 505 Bytes
Versions: 8
Compression:
Stored size: 505 Bytes
Contents
# encoding: utf-8 require 'date' begin d = ::Date.today d.freeze d.year needs_patch = false rescue 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
8 entries across 8 versions & 1 rubygems