Giter VIP home page Giter VIP logo

term-spinner-lite's Introduction

NAME
    Term::Spinner::Lite - A spinner without so much Moose in it

VERSION
    version 0.03

SYNOPSIS
      use utf8;
      use 5.010;
      use Term::Spinner::Lite;
      my $s = Term::Spinner::Lite->new(
        delay => 100_000,
        spin_chars => ['◑', '◒', '◐', '◓'],
      );

      $s->next() for 1 .. 100_000;
      $s->done();

    This is a simple spinner, useful when you want to show some kind of
    activity during a long-running activity of non-determinant length. It's
    loosely based on the API from Term::Spinner. Unlike Term::Spinner
    though, this module doesn't have any dependencies outside of modules
    shipped with Perl itself.

ATTRIBUTES
  output_handle
    Gets or sets the handle where output will be written. By default, uses
    STDERR. You may pass an optional PerlIO encoding specification. By
    default it will use ":utf8" in case you want to use UTF8 characters in
    your spinner.

  spin_chars
    Gets or sets the list of characters to cycle through. By default it uses
    the sequence "-" "\" "|" "/". This attribute must be set using an array
    ref, e.g.,

      [ qw( . o O o ) ]

    This attribute will croak by an attempt to set itself using anything
    else.

  delay
    Gets or sets the delay between state changes in microseconds. (A good
    value for smooth spinning is 100000.) Defaults to 0.

METHODS
  new()
    The object constructor. You may optionally set object attributes
    "spin_chars" or "output_handle" in the parameter list.

  count()
    Return the number of advances through the spin sequence.

  next()
    Advance the spinner state to the next character in the spin sequence and
    output it to "output_handle".

  done()
    Finish spinning, and clear the last character printed. If a true value
    is passed, output a newline.

AUTHOR
    Mark Allen <[email protected]>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2012 by Mark Allen.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

term-spinner-lite's People

Contributors

jadeallenx avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.