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