[ANN] HighLine 0.5.0

Discussion in 'Ruby' started by James Edward Gray II, May 10, 2005.

  1. HighLine 0.5.0 Released
    =======================

    This release brings three new features: an echo setting (for
    passwords), case changing controls for answers, and confirmation
    questions. As always, using these features is trivial. Here are a
    couple of simple examples:

    pass = ask("Password? ") { |q| q.echo = false }
    file = ask("File to delete? ") { |q| q.confirm = true }

    See documentation and examples for more details.

    If anyone uses this, feedback is welcome
    (). I do have a TODO list of features I
    would like to add, but I'm also open to suggestions of how to grow
    the project and make in useful to all.

    If you have any trouble with character reading or echo, especially on
    Windows, please let me know.

    What is HighLine?
    -----------------

    (from the README)

    HighLine was designed to ease the tedious tasks of doing console
    input and output with low-level methods like gets() and puts().
    HighLine provides a robust system for requesting data from a user,
    without needing to code all the error checking and validation rules
    and without needing to convert the typed Strings into what your
    program really needs. Just tell HighLine what you're after, and let
    it do all the work.

    What's new in this release?
    ---------------------------

    (highlights from the CHANGELOG)

    * Implemented echo=() for HighLine::Question objects, primarily to
    make fetching passwords trivial.
    * Implemented case=() for HighLine::Question objects to provide
    character case
    conversions on given answers. Can be set to :up, :down,
    or :capitalize.
    * Implemented confirm=() for HighLine::Question objects to allow for
    verification
    for sensitive user choices. If set to true, user will have to
    answer an
    "Are you sure? " question. Can also be set to the question to
    confirm with
    the user.

    Plus documentation and examples for the new features.

    Where can I learn more?
    -----------------------

    HighLine is hosted on RubyForge.

    Project page: http://rubyforge.org/projects/highline/
    Documentation: http://highline.rubyforge.org/
    Downloads: http://rubyforge.org/frs/?group_id=683

    How do I get HighLine?
    ----------------------

    HighLine is a gem, so as long as you have RubyGems installed it's as
    simple as:

    $ sudo gem install highline

    If you need to install RubyGems, you can download it from:

    http://rubyforge.org/frs/?group_id=126&release_id=1885

    HighLine can also be installed manually. Just download the latest
    release and follow the instructions in INSTALL:

    http://rubyforge.org/frs/?group_id=683&release_id=2158

    James Edward Gray II
    James Edward Gray II, May 10, 2005
    #1
    1. Advertising

  2. On May 9, 2005, at 7:44 PM, James Edward Gray II wrote:

    > This release brings three new features: an echo setting (for
    > passwords)


    Darn it, forgot credit where credit is due!

    The above feature was inspired and made possible by extensive help
    from Vincent Foley, Ryan Leavengood, and Andre Nathan. Thank you all!

    James Edward Gray II
    James Edward Gray II, May 10, 2005
    #2
    1. Advertising

  3. On May 9, 2005, at 5:44 PM, James Edward Gray II wrote:

    > HighLine 0.5.0 Released
    > =======================
    >


    Hey James & friends-
    I wanted to thank you for this great library. I have a project
    that this will be perfect for. Great Job!
    Thanks-
    -Ezra
    Ezra Zygmuntowicz, May 10, 2005
    #3
  4. James Edward Gray II <> wrote:
    >
    > This release brings three new features: an echo setting (for
    > passwords), case changing controls for answers, and confirmation
    > questions. As always, using these features is trivial. Here are a
    > couple of simple examples:
    >
    > pass = ask("Password? ") { |q| q.echo = false }


    More flexible might be

    q.echo = true #=> echo
    q.echo = false #=> don't echo
    q.echo = char #=> echo char for every keypress (e.g. '*')

    martin
    Martin DeMello, May 10, 2005
    #4
  5. Re: HighLine 0.5.0

    I would really be interested in contributing some code. I'm not
    exactly sure how to do that though, although I have done Ruby coding
    for a while now, I never helped on somebody else's project.
    Vincent Foley, May 10, 2005
    #5
  6. James Edward Gray II

    Guest

    Re: HighLine 0.5.0

    Well, when I asked James, he told me to hop onto the CVS, read the TODO
    file, and fire him a patch via email when I was ready. Though he ended
    up finishing up word-wrap on his own, I helped him out a bit, and it's
    as easy as grabbing the source from the CVS anonymously, picking
    something you like from the TODO list, and emailing him your patch.
    Bonus points if you write up your own unit tests for him. His code is
    well documented and easy to work with, so just hit up the CVS on
    rubyforge and I'm sure he'll be happy to accept a solution if you get
    something working.
    , May 10, 2005
    #6
  7. On May 9, 2005, at 11:29 PM, Martin DeMello wrote:

    > More flexible might be
    >
    > q.echo = true #=> echo
    > q.echo = false #=> don't echo
    > q.echo = char #=> echo char for every keypress (e.g. '*')


    Great idea. Added it to the TODO. Thanks.

    James Edward Gray II
    James Edward Gray II, May 10, 2005
    #7
  8. Re: HighLine 0.5.0

    On May 9, 2005, at 11:54 PM, Vincent Foley wrote:

    > I would really be interested in contributing some code. I'm not
    > exactly sure how to do that though, although I have done Ruby coding
    > for a while now, I never helped on somebody else's project.


    Greg explained the process pretty well in his response. As he said,
    check out the CVS, change some code, then use the "cvs diff" command
    to generate a patch file and send it to me in an email. It's not hard.

    Getting familiar with the code it probably the only tricky step, but
    I try to keep it clean and well commented. HighLine is built with a
    practice called Test Driven Development, so the test files (in the
    test/ directory) cover every single feature I've added. They should
    help you make sense of things. From the root project directory, you
    can run those tests with "rake" (if you have Rake installed) or "ruby
    test/ts_all.rb".

    This also means that any feature added to HighLine needs to come with
    tests that cover it. Write those first, I say, so you can see what
    you're trying to implement. Then go tinker until the tests start
    passing.

    Currently, the two files you would be adding features to are lib/
    highline.rb and lib/highline/question.rb. highline.rb covers
    terminal encapsulation features, while question.rb stores the state
    of each question. They work in tandem to accomplish some things.

    Finally, don't be afraid to ask questions. I won't bite. The TODO
    probably makes more sense to me than anyone else, for example, so ask
    me to translate if needed.

    Thanks for the interest!

    James Edward Gray II
    James Edward Gray II, May 10, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Edward Gray II

    [ANN] HighLine 0.2.0

    James Edward Gray II, Apr 29, 2005, in forum: Ruby
    Replies:
    2
    Views:
    96
    James Edward Gray II
    Apr 29, 2005
  2. James Edward Gray II

    [ANN] HighLine 0.3.0 -- Now with ANSI colors!

    James Edward Gray II, May 4, 2005, in forum: Ruby
    Replies:
    0
    Views:
    100
    James Edward Gray II
    May 4, 2005
  3. James Edward Gray II

    [ANN] HighLine 0.4.0

    James Edward Gray II, May 7, 2005, in forum: Ruby
    Replies:
    28
    Views:
    243
    James Edward Gray II
    May 12, 2005
  4. James Edward Gray II

    [ANN] HighLine 0.6.0 -- Now with menus!

    James Edward Gray II, May 20, 2005, in forum: Ruby
    Replies:
    15
    Views:
    211
    Bill Guindon
    May 23, 2005
  5. James Edward Gray II

    [ANN] HighLine 0.6.1

    James Edward Gray II, May 23, 2005, in forum: Ruby
    Replies:
    8
    Views:
    146
    Lloyd Zusman
    May 24, 2005
Loading...

Share This Page