[ANN] HighLine 0.6.1

HighLine 0.6.1 Released

···

=======================

This release should fix the Windows install issue.

I decided against using two separate gems. That doesn't sound comfortable for me, or the users. (Windows users would need to remember to install highline-win to get a working copy? Yuck.)

Instead, I've disabled the termios dependancy in the gem. HighLine is unaffected by this change, since it has always been able to run without it. We've just shifted termios from a "dependancy" to an "optional extra" (recommended for Unix users). Those of you who want to use it just need to make the additional install and HighLine will switch over.

The INSTALL documentation has been updated to reflect this change.

I plan to revisit this issue if/when RubyGems gives me better control over install dependancies.

My apologies to the Windows users who struggled with the last release.

If anyone uses this, feedback is welcome (james@grayproductions.net). We do have a TODO list of features we would like to add, but we're also open to suggestions.

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?
---------------------------

* Removed termios dependancy in gem, to fix Windows' install.

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 will take advantage of the termios library, if installed. This is a recommended optional extra for Unix users. To add that gem, simply:

$ sudo gem install termios

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=2219

James Edward Gray II
Greg Brown

James Edward Gray II <james@grayproductions.net> writes:

[ ... ]

$ sudo gem install termios

The gem install of highline went smoothly. However, when I did the
install for termios, I got the errors below. Even though I received the
"successfully installed" message, I'm not sure whether that actually
occurred.

Any ideas?

  # ruby --version
  ruby 1.9.0 (2005-02-05) [i686-linux]
  # uname -r
  2.4.20-021stab028.5.777-enterprise
  # gem install termios
  Attempting local installation of 'termios'
  Local gem file not found: termios*.gem
  Attempting remote installation of 'termios'
  Building native extensions. This could take a while...
  Makefile:108: warning: overriding commands for target
    `/usr/local/lib/ruby/gems/1.9/gems/termios-0.9.4/lib'
  Makefile:106: warning: ignoring old commands for target
    `/usr/local/lib/ruby/gems/1.9/gems/termios-0.9.4/lib'
  termios.c: In function `termios_tcgetattr':
  termios.c:204: structure has no member named `f'
  termios.c: In function `termios_tcsetattr':
  termios.c:246: structure has no member named `f'
  termios.c: In function `termios_tcsendbreak':
  termios.c:271: structure has no member named `f'
  termios.c: In function `termios_tcdrain':
  termios.c:295: structure has no member named `f'
  termios.c: In function `termios_tcflush':
  termios.c:325: structure has no member named `f'
  termios.c: In function `termios_tcflow':
  termios.c:355: structure has no member named `f'
  termios.c: In function `termios_tcgetpgrp':
  termios.c:379: structure has no member named `f'
  termios.c: In function `termios_tcsetpgrp':
  termios.c:404: structure has no member named `f'
  make: *** [termios.o] Error 1
  Makefile:108: warning: overriding commands for target
    `/usr/local/lib/ruby/gems/1.9/gems/termios-0.9.4/lib'
  Makefile:106: warning: ignoring old commands for target
    `/usr/local/lib/ruby/gems/1.9/gems/termios-0.9.4/lib'
  termios.c: In function `termios_tcgetattr':
  termios.c:204: structure has no member named `f'
  termios.c: In function `termios_tcsetattr':
  termios.c:246: structure has no member named `f'
  termios.c: In function `termios_tcsendbreak':
  termios.c:271: structure has no member named `f'
  termios.c: In function `termios_tcdrain':
  termios.c:295: structure has no member named `f'
  termios.c: In function `termios_tcflush':
  termios.c:325: structure has no member named `f'
  termios.c: In function `termios_tcflow':
  termios.c:355: structure has no member named `f'
  termios.c: In function `termios_tcgetpgrp':
  termios.c:379: structure has no member named `f'
  termios.c: In function `termios_tcsetpgrp':
  termios.c:404: structure has no member named `f'
  make: *** [termios.o] Error 1
  ruby extconf.rb install termios
  checking for termios.h... yes
  checking for unistd.h... yes
  creating Makefile

  make
  gcc -fPIC -g -O2 -fPIC -I. -I/usr/local/lib/ruby/1.9/i686-linux
    -I/usr/local/lib/ruby/1.9/i686-linux -I. -DHAVE_TERMIOS_H
    -DHAVE_UNISTD_H -c termios.c

  make install
  gcc -fPIC -g -O2 -fPIC -I. -I/usr/local/lib/ruby/1.9/i686-linux
    -I/usr/local/lib/ruby/1.9/i686-linux -I. -DHAVE_TERMIOS_H
    -DHAVE_UNISTD_H -c termios.c
  Successfully installed termios-0.9.4

···

--
Lloyd Zusman
ljz@asfast.com
God bless you.

Are you running in Windows or *nix.
If you are on windows, you do not need termios for anything, so do not
worry.

If you are running *nix, a quick way to check if termios was installed
properly is if the problem that requires termios is fixed or not. run
examples/password.rb and jam on the keyboard very fast. If some keys
leak through, then the termios gem probably did not install properly.
If not, then you should be okay.

This is the only known issue that seperates stty from termios as far as
HighLine is concerned, therefore, if you aren't planning on using
HighLine for passwords, you won't need it at all.

It sounds like your issue is with termios, not HighLine, so I am not
sure I can be of much help... if anyone else has the answer though,
please post it.

James is going to be mostly AFK for the next couple days, so if anyone
has any HighLine questions they want to ask off list, feel free to
email me: greg7224 at gmail dot com

Can you tell me what the following code prints?

require "rubygems"
require "highline"

p HighLine::CHARACTER_MODE

__END__

Thanks.

James Edward Gray II

···

On May 23, 2005, at 4:34 PM, Lloyd Zusman wrote:

James Edward Gray II <james@grayproductions.net> writes:

[ ... ]

$ sudo gem install termios

The gem install of highline went smoothly. However, when I did the
install for termios, I got the errors below. Even though I received the
"successfully installed" message, I'm not sure whether that actually
occurred.

Any ideas?

whoops... missed the uname listing and jumped to conclusions.

Maybe the gem has issues with ruby 1.9.0?

I suggest testing to see if the bug is still there by running
examples/password.rb
If it isn't then termios should be working.

James Edward Gray II <james@grayproductions.net> writes:

[ ... ]

Can you tell me what the following code prints?

require "rubygems"
require "highline"

p HighLine::CHARACTER_MODE

__END__

  # irb
  irb(main):001:0> require "rubygems"
  => true
  irb(main):002:0> require "highline"
  LoadError: No such file to load -- highline
          from /usr/local/lib/ruby/site_ruby/1.9/rubygems/custom_require.rb:18:in `require__'
          from /usr/local/lib/ruby/site_ruby/1.9/rubygems/custom_require.rb:18:in `require'
          from (irb):2
  irb(main):003:0>
  irb(main):004:0* p HighLine::CHARACTER_MODE
  NameError: uninitialized constant HighLine
          from (irb):4
  irb(main):005:0>

This is weird, because prior to this, "gem install highline" worked, and
I indeed have the /usr/local/lib/ruby/gems/1.9/gems/highline-0.6.1
directory and all of its contents.

So I went into that directory and typed "ruby setup.rb". It ran fine,
and immediately thereafter, I ran the code again:

  # irb
  irb(main):001:0> require "rubygems"
  => true
  irb(main):002:0> require "highline"
  => true
  irb(main):003:0> p HighLine::CHARACTER_MODE
  "termios"
  => nil

So now it looks like there are two problems:

1. rubygems installs don't always work for me

2. termios doesn't appear to compile properly on my system, although
   it seems to install

···

--
Lloyd Zusman
ljz@asfast.com
God bless you.

"Greg Brown" <greg7224@gmail.com> writes:

whoops... missed the uname listing and jumped to conclusions.

Maybe the gem has issues with ruby 1.9.0?

I suggest testing to see if the bug is still there by running
examples/password.rb
If it isn't then termios should be working.

  # cd /usr/local/lib/ruby/gems/1.9/gems/highline-0.6.1
  # ruby examples/password.rb
  Enter your password: [ I entered "abcdefg" followed by a newline ]
  Your password is abcdefg!

···

#

Well, termios is now working, but that's because I had previously
manually changed the source code to get rid of the compile errors: in
"termios.c", I changed all occurences of "fptr->f" to
"fptr->stdio_file". Is this a ruby-1.9-ism?

Also, note that I ran this _after_ having manually invoked
"ruby setup.rb" in /usr/local/lib/ruby/gems/1.9/gems/highline-0.6.1.
I did this because the gem install of highline didn't work (see my other
message from today that's been posted to this thread).

--
Lloyd Zusman
ljz@asfast.com
God bless you.

These are indeed strange issues. I wish I could provide some intelligent insights into what's going on here, but we're out of my knowledge base now.

At lest it seems that you know have a working unstall. That's some good news.

James Edward Gray II

···

On May 24, 2005, at 4:08 AM, Lloyd Zusman wrote:

So now it looks like there are two problems:

1. rubygems installs don't always work for me

2. termios doesn't appear to compile properly on my system, although
   it seems to install

James Edward Gray II <james@grayproductions.net> writes:

So now it looks like there are two problems:

1. rubygems installs don't always work for me

2. termios doesn't appear to compile properly on my system, although
   it seems to install

These are indeed strange issues. I wish I could provide some
intelligent insights into what's going on here, but we're out of my
knowledge base now.

At lest it seems that you know have a working unstall. That's some
good news.

Yes. All's well that ends well, and I won't belabor the point any
further.

I now think that I understand the termios issue, which is a change in
the OpenFile struct in "rubyio.h" which probably occured in 1.9
(changing the name of te 'f' element to to 'stdio_file'). As for the
gem thing, I'll just keep investigating it on my own time, and if I come
up with any insights, I'll post them here.

···

On May 24, 2005, at 4:08 AM, Lloyd Zusman wrote:

--
Lloyd Zusman
ljz@asfast.com
God bless you.