module PackerFiles::Utils::Size
Contains utility functions to manage size conversions
Public Instance Methods
Bytes(size)
click to toggle source
MiB(size)
click to toggle source
Convert a text 'size' into a units of MiB
. This is done calling the appropriate lambda function, whenever the regex is matched.
# File lib/PackerFiles/Utils/Size.rb, line 27 def MiB(size) @@regex.each_pair do |r, l| if m = r.match(size) return l.call(m[1].to_i) end end end