commit 7d55ce958d23d0ca436baf1643abfcc25c41f1ec135813e16131a2bb52e7b12b Author: Dirk Stoecker Date: Thu Oct 29 08:01:38 2020 +0000 Accepting request 844725 from devel:languages:perl:CPAN-S For perl-Text-Table-Manifold for perl-DBIx-Admin-TableInfo OBS-URL: https://build.opensuse.org/request/show/844725 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-String-TtyLength?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/String-TtyLength-0.02.tar.gz b/String-TtyLength-0.02.tar.gz new file mode 100644 index 0000000..43dd45e --- /dev/null +++ b/String-TtyLength-0.02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8f166ff7200c367642d1a0573a07d62f9aea29ccc68b0cd3cb824b59fb22074 +size 10860 diff --git a/perl-String-TtyLength.changes b/perl-String-TtyLength.changes new file mode 100644 index 0000000..b61ed3e --- /dev/null +++ b/perl-String-TtyLength.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Thu Oct 29 07:59:56 UTC 2020 - Dirk Stoecker + +- initial package 0.02 + * created by cpanspec 1.78.09 diff --git a/perl-String-TtyLength.spec b/perl-String-TtyLength.spec new file mode 100644 index 0000000..d23e10b --- /dev/null +++ b/perl-String-TtyLength.spec @@ -0,0 +1,81 @@ +# +# spec file for package perl-String-TtyLength +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: perl-String-TtyLength +Version: 0.02 +Release: 0 +%define cpan_name String-TtyLength +Summary: Length or width of string excluding ANSI tty codes +License: Artistic-1.0 OR GPL-1.0-or-later +Group: Development/Libraries/Perl +URL: https://metacpan.org/release/%{cpan_name} +Source0: https://cpan.metacpan.org/authors/id/N/NE/NEILB/%{cpan_name}-%{version}.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: perl +BuildRequires: perl-macros +BuildRequires: perl(Test2::V0) +BuildRequires: perl(Unicode::EastAsianWidth) >= 12.0 +BuildRequires: perl(parent) +Requires: perl(Unicode::EastAsianWidth) >= 12.0 +Requires: perl(parent) +%{perl_requires} + +%description +This module provides two functions which tell you the length and width of a +string as it will appear on a terminal (tty), excluding any ANSI escape +codes. + +'tty_length' returns the length of a string excluding any ANSI tty / +terminal escape codes. + +'tty_width' returns the number of columns on a terminal that the string +will take up, also excluding any escape codes. + +For non-wide characters, the functions will return the same value. But +consider the following: + + my $emoji = "😄"; + my $length = tty_length($emoji); # 1 + my $width = tty_width($emoji); # 2 + +If you're trying to align text in columns, then you'll probably want +'tty_width'; if you just want to know the number of characters, using +'tty_length'. + +%prep +%setup -q -n %{cpan_name}-%{version} + +%build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%check +make test + +%install +%perl_make_install +%perl_process_packlist +%perl_gen_filelist + +%files -f %{name}.files +%defattr(-,root,root,755) +%doc Changes README +%license LICENSE + +%changelog