14 Aug 2012, 23:58
Dmfcb_pragsmall

David Copeland (98 posts)

I just released GLI version 2 tonight and while it is almost entirely backward compatible with the version used in the book, a few things need to change.

First off, if you are using the versions of gems in the code download’s @Gemfile@ (e.g. via @bundle install@), then you are good and you can stop reading here. Everything’s fine.

IF, you either are using GLI 2, or would like to, here’s what you’ll need to know:

  • @exit GLI.run(ARGV)@ no longer works. You’ll need to replace it with @exit run(ARGV)@. This doesn’t work in GLI 1.x
  • On page 28 of the ebook, the code snippet there says to use @exit GLI.run(ARGV)@. This won’t work with 2.x, and it would need to be @exit run*ARGV)@ as described above

That’s it. Everything else works.

I’m working on getting a code update that uses GLI 2 available, but I want to let it settle for a bit first. As always, email me, or post issues at GLI’s github page:http://www.github.com/davetron5000/gli

12 Jun 2013, 16:08
Generic-user-small

Bryan Lockwood (3 posts)

I have gli 2.5.6 installed. After typing ‘gli scaffold to-do new list add’, I type ‘bundle exec bin/to-do’ It ‘works’ but I get this warning:

The source :rubygems is deprecated because HTTP requests are insecure. Please change your source to ‘https://rubygems.org’ if possible, or ‘http://rubygems.org’ if not.

OK, so I changed the Gemfile as indicated, and the error goes away.

The book indicates that ‘bin/to-do new’ will recognize the command but do nothing, but it prints the same help information as it does with no command. And since in the scaffold code I see the line ‘puts “new command ran”’ in the action block for the :new command, I expected to at least see that. In fact that does not print.

Since I haven’t touched the scaffold code, I presume gli 2.5.6 has a bug in it. Am I correct?

BTW: Absolutely SUPER book! Lots of good info. Great exposition. Thanks.

I’ll be even more thankful if I can get gli to work:-)

13 Jun 2013, 06:53
Generic-user-small

Bryan Lockwood (3 posts)

The problem was that I was using Ruby 1.9.2. When I switched rvm over to 1.9.3 and installed the necessary gems, things worked like a charm.

  You must be logged in to comment