From 69a2913af10e5eb35e1178ef97e13554fc756cb8 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Sat, 14 Dec 2024 00:50:26 +0100 Subject: [PATCH] 0.0.4 --- Changes | 2 ++ META6.json | 36 +++++++++++++++++++----------- README.md | 65 ++++++++++++++++++++++++++++++++---------------------- 3 files changed, 64 insertions(+), 39 deletions(-) diff --git a/Changes b/Changes index 277974c..c3e1cfd 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ Revision history for Number::Bytes::Human {{$NEXT}} + +0.0.4 2024-12-14T00:50:16+01:00 - Initial version diff --git a/META6.json b/META6.json index ae59919..770bef5 100644 --- a/META6.json +++ b/META6.json @@ -1,15 +1,25 @@ { - "perl": "6.c", - "name": "Number::Bytes::Human", - "license" : "MIT", - "version": "0.0.3", - "description": "Convert byte count into an easy to read format", - "auth": "zef:raku-community-modules", - "authors": ["Douglas L. Jenkins"], - "provides": { - "Number::Bytes::Human": "lib/Number/Bytes/Human.rakumod" - }, - "depends": [], - "resources": [], - "source-url": "git://github.com/dugword/Number-Bytes-Human.git" + "auth": "zef:raku-community-modules", + "authors": [ + "Douglas L. Jenkins" + ], + "build-depends": [ + ], + "depends": [ + ], + "description": "Convert byte count into an easy to read format", + "license": "MIT", + "name": "Number::Bytes::Human", + "perl": "6.c", + "provides": { + "Number::Bytes::Human": "lib/Number/Bytes/Human.rakumod" + }, + "resources": [ + ], + "source-url": "https://github.com/raku-community-modules/Number-Bytes-Human.git", + "tags": [ + ], + "test-depends": [ + ], + "version": "0.0.4" } diff --git a/README.md b/README.md index a2d23bf..0f4cd48 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,64 @@ +[![Actions Status](https://github.com/raku-community-modules/Number-Bytes-Human/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Number-Bytes-Human/actions) [![Actions Status](https://github.com/raku-community-modules/Number-Bytes-Human/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Number-Bytes-Human/actions) [![Actions Status](https://github.com/raku-community-modules/Number-Bytes-Human/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Number-Bytes-Human/actions) + NAME -================================================================================ -Number::Bytes::Human - Converts byte count into an easy to read format. +==== -SYNOPSIS -================================================================================ - # Functional interface - use Number::Bytes::Human :functions; - my $size = format-bytes 1024; # '1K' +Number::Bytes::Human - Convert byte count into an easy to read format - my $bytes = parse-bytes '1.0K'; # 1024 +SYNOPSIS +======== - exit; +```raku +# Functional interface +use Number::Bytes::Human :functions; +my $size = format-bytes 1024; # '1K' +my $bytes = parse-bytes '1.0K'; # 1024 - # OO Interface - my Number::Bytes::Human; - my $human = Number::Bytes::Human.new; +# OO Interface +my Number::Bytes::Human; +my $human = Number::Bytes::Human.new; - my $size = $human.format(1024); # '1K' - my $bytes = $human.parse('1.0K'); # 1024 +my $size = $human.format(1024); # '1K' +my $bytes = $human.parse('1.0K'); # 1024 +``` DESCRIPTION -================================================================================ -This is the Perl6 re-write of CPAN's Number::Bytes::Human. Special thanks to the -original author: Adriano R. Ferreira, +=========== -NOTE: This module is version 0.0.X and is subject to significant changes in the -API with no notice. +This is the Raku re-write of CPAN's `Number::Bytes::Human` module. Special thanks to the original author: Adriano R. Ferreira. -The Number::Bytes::Human Perl6 module converts large numbers of bytes into -a more human friendly format, e.g. '15G'. The functionality of this module -will be similar to the `-h` switch on Unix commands like `ls`, `du`, and `df`. +The `Number::Bytes::Humani` module converts large numbers of bytes into a more human friendly format, e.g. '15G'. The functionality of this module will be similar to the `-h` switch on Unix commands like `ls`, `du`, and `df`. -Currently the module rounds to the nearest whole unit, this behavior will likely change in the future. +Currently the module rounds to the nearest whole unit. -From the FreeBSD man page of df: http://www.freebsd.org/cgi/man.cgi?query=df +From the FreeBSD man page of df: [http://www.freebsd.org/cgi/man.cgi?query=df](http://www.freebsd.org/cgi/man.cgi?query=df) "Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. - + byte B kilobyte K = 2**10 B = 1024 B megabyte M = 2**20 B = 1024 * 1024 B gigabyte G = 2**30 B = 1024 * 1024 * 1024 B terabyte T = 2**40 B = 1024 * 1024 * 1024 * 1024 B - + petabyte P = 2**50 B = 1024 * 1024 * 1024 * 1024 * 1024 B exabyte E = 2**60 B = 1024 * 1024 * 1024 * 1024 * 1024 * 1024 B zettabyte Z = 2**70 B = 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 B yottabyte Y = 2**80 B = 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 B + +AUTHOR +====== + +Douglas L. Jenkins + +COPYRIGHT AND LICENSE +===================== + +Copyright 2016 - 2017 Douglas L. Jenkins + +Copyright 2024 Raku Community + +This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0. +