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