/usr/lib/ruby/vendor_ruby/active_support/core_ext/numeric/bytes.rb is in ruby-activesupport-3.2 3.2.16-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | class Numeric
KILOBYTE = 1024
MEGABYTE = KILOBYTE * 1024
GIGABYTE = MEGABYTE * 1024
TERABYTE = GIGABYTE * 1024
PETABYTE = TERABYTE * 1024
EXABYTE = PETABYTE * 1024
# Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
def bytes
self
end
alias :byte :bytes
def kilobytes
self * KILOBYTE
end
alias :kilobyte :kilobytes
def megabytes
self * MEGABYTE
end
alias :megabyte :megabytes
def gigabytes
self * GIGABYTE
end
alias :gigabyte :gigabytes
def terabytes
self * TERABYTE
end
alias :terabyte :terabytes
def petabytes
self * PETABYTE
end
alias :petabyte :petabytes
def exabytes
self * EXABYTE
end
alias :exabyte :exabytes
end
|