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