| TYPE_PREFIXES |
= |
{ # Unit prefixes used for SI file sizes. :SI => %w{k M G T P E Z Y}, # Unit prefixes used for binary file sizes. :BINARY => %w{Ki Mi Gi Ti Pi Ei Zi Yi} |
| PREFIXES |
= |
TYPE_PREFIXES[:SI] |
|
@deprecated Please use TYPE_PREFIXES[:SI] instead
|
| SI |
= |
{ :regexp => /^([\d,.]+)?[[:space:]]?([kmgtpezy]?)b?$/i, :multiplier => 1000, :prefixes => TYPE_PREFIXES[:SI], :presuffix => '' |
|
Set of rules describing file sizes according to SI units.
|
| BINARY |
= |
{ :regexp => /^([\d,.]+)?[[:space:]]?(?:([kmgtpezy])i)?b?$/i, :multiplier => 1024, :prefixes => TYPE_PREFIXES[:BINARY], :presuffix => 'i' |
|
Set of rules describing file sizes according to binary units.
|
| Floppy |
= |
Filesize.from("1474 KiB") |
|
The size of a floppy disk
|
| DVD_5 |
= |
Filesize.from("4.38 GiB") |
|
The size of a common DVD
|
| DVD_9 |
= |
Filesize.from("7.92 GiB") |
|
The size of a single-sided dual-layer DVD
|
| DVD_10 |
= |
DVD_5 * 2 |
|
The size of a double-sided single-layer DVD
|
| DVD_14 |
= |
DVD_9 + DVD_5 |
|
The size of a double-sided DVD, combining a DVD-9 and a DVD-5
|
| DVD_18 |
= |
DVD_14 * 2 |
|
The size of a double-sided dual-layer DVD
|