Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../opt/alt/ruby30/share/ruby
File: date.rb
# frozen_string_literal: true
[0] Fix | Delete
# date.rb: Written by Tadayoshi Funaba 1998-2011
[1] Fix | Delete
[2] Fix | Delete
require 'date_core'
[3] Fix | Delete
[4] Fix | Delete
class Date
[5] Fix | Delete
VERSION = '3.1.3' # :nodoc:
[6] Fix | Delete
[7] Fix | Delete
def infinite?
[8] Fix | Delete
false
[9] Fix | Delete
end
[10] Fix | Delete
[11] Fix | Delete
class Infinity < Numeric # :nodoc:
[12] Fix | Delete
[13] Fix | Delete
def initialize(d=1) @d = d <=> 0 end
[14] Fix | Delete
[15] Fix | Delete
def d() @d end
[16] Fix | Delete
[17] Fix | Delete
protected :d
[18] Fix | Delete
[19] Fix | Delete
def zero?() false end
[20] Fix | Delete
def finite?() false end
[21] Fix | Delete
def infinite?() d.nonzero? end
[22] Fix | Delete
def nan?() d.zero? end
[23] Fix | Delete
[24] Fix | Delete
def abs() self.class.new end
[25] Fix | Delete
[26] Fix | Delete
def -@() self.class.new(-d) end
[27] Fix | Delete
def +@() self.class.new(+d) end
[28] Fix | Delete
[29] Fix | Delete
def <=>(other)
[30] Fix | Delete
case other
[31] Fix | Delete
when Infinity; return d <=> other.d
[32] Fix | Delete
when Numeric; return d
[33] Fix | Delete
else
[34] Fix | Delete
begin
[35] Fix | Delete
l, r = other.coerce(self)
[36] Fix | Delete
return l <=> r
[37] Fix | Delete
rescue NoMethodError
[38] Fix | Delete
end
[39] Fix | Delete
end
[40] Fix | Delete
nil
[41] Fix | Delete
end
[42] Fix | Delete
[43] Fix | Delete
def coerce(other)
[44] Fix | Delete
case other
[45] Fix | Delete
when Numeric; return -d, d
[46] Fix | Delete
else
[47] Fix | Delete
super
[48] Fix | Delete
end
[49] Fix | Delete
end
[50] Fix | Delete
[51] Fix | Delete
def to_f
[52] Fix | Delete
return 0 if @d == 0
[53] Fix | Delete
if @d > 0
[54] Fix | Delete
Float::INFINITY
[55] Fix | Delete
else
[56] Fix | Delete
-Float::INFINITY
[57] Fix | Delete
end
[58] Fix | Delete
end
[59] Fix | Delete
[60] Fix | Delete
end
[61] Fix | Delete
[62] Fix | Delete
end
[63] Fix | Delete
[64] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function